10 Replies Latest reply on Aug 7, 2015 1:40 PM by user_14586677

    Keyfob Receiver

    user_453804851

      Hello all!

         

      I'm using the Pioneer Kit and trying to receive and process the press of a button from a keyfob (iTag.)

         

      I have a couple of issues:

         

      1)  How do I connect the PSoC to the iTag.  I know from CySmart that it's address is FF:FF:00:00:F3:08

         

             (I have a second one that is address ending in 9D:0F)

         

      2)  The device sends the Battery Level with a handle of 30 (UUID: 2A19) wth a value of 64 which I assume shows to a full battery.  Is there a way to turn that off without reprogramming the iTag?

         

      3)  When the button on the tag is pressed, it sends Handle 35 (UUID: FFE1) with a value of 01.  This is the one I want to use to toggle an output.

         

      My intention is to use the iFobs to turn on and off alarms.  Any assistance is greatly appreciated.

         

      The iFob is using a Beken BK3431 that I can't find any data on, so I think everything needs to be done on the PSoC side.

         

      Dan

        • 1. Re: Keyfob Receiver
          bmah

          Hi Dan,

             

          Do you want to directly establish a connection with the iTag based on its address? To connect to the peer device, you can use CyBle_GapcConnectDevice after the target device is discovered by CyBle_GapcStartScan() and further scanning has stopped.

             

          Can you clarify your second question? What would you like to turn off?

          • 2. Re: Keyfob Receiver
            rohit.kumar

            Morantz,

               

            1) As BMAH pointed out, use CyBle_GapcStartScan() to scan for svailable devices to connecet. When you get a event CYBLE_EVT_GAPC_SCAN_PROGRESS_RESULT, then check if the bdAddr of the returned parameter matches the addres you want to connect to. Issue the connect using 'CyBle_GapcConnectDevice() '.

               

            But I would rather suggest you to not restrict your PSoC to connect to only one iTag. If you want any iTag to be found and connected to using PSoC, then use other fields of the returned parameter (adv/scan report). This could be the name, or UUID or some custom data.

               

            2) How do you receive the battery information? Is it through a characteristic read by the connected device or notification/indication from iTag? 

               

            In case of 'characteristic read', you need to ensure that the Central device (PSoC in this case) does not send the read command at that handle.

               

            If it is Notification/indication, then it is relatively simple. It must have a CCCD associated with the characteristic (handle 30), where you need to write a 16-bit value equal to 0x0000. This way, you will tell iTag to disable notification/indication. I can make a fair guess that the CCCD will be attribute handle value 31 (one more than characteristic it is associated with), unless iTag firmware has done custom change.

               

             

               

            3) Because iTag has a button, I can assume that the characteristic over which the Button value is sent supports notification or indication. Else the connected Central device has to periodically send a read command, which is not super efficient. Just as explained in point 2 above, you can enable the notification (or indication) by writing 0x0001 (or 0x0002) to the CCCD associated with Handle 35. Use 'CyBle_GattcWriteCharacteristicValue' function. If this works, then you will receive the button press notification under 'CYBLE_EVT_GATTC_HANDLE_VALUE_NTF' event or if it is indication, it will be received under 'CYBLE_EVT_GATTC_HANDLE_VALUE_IND' event.

               

             

               

            I would suggest you to go through the example project at https://github.com/cypresssemiconductorco/PSoC-4-BLE/tree/master/100_Projects_in_100_Days/Day006_Central_IAS 

            1 of 1 people found this helpful
            • 3. Re: Keyfob Receiver
              user_453804851

              Morning Roit!

                 

              Thanks for getting back to me.  I'm going to be using this in an alarm system.  So having it attach to ANY iTag would be a problem.  And there are going to be 700 of these alarms (they are for a secure box on vehicles...)  One person with correct FOB should have access....

                 

              The iTag is using notifications, so I will try that 16-bit 0x0000 write to solve that.

                 

              I will check out the link when I get back to that PC.  

                 

              Thanks!

              • 4. Re: Keyfob Receiver
                user_453804851

                Hello BMAH!  

                   

                Yes, a direct connection based on address is what I'm wanting.  Preferably without too much scanning.  Maybe some sort of whitelist?

                   

                My second question is about a notification being passed every 10 seconds or so.  Roit has given me a possible solution for that one, so I hope to have that one solved. 

                   

                Thanks for getting back to me!

                   

                Dan

                • 5. Re: Keyfob Receiver
                  user_10354431

                  Hi Morantz,

                     

                  The ideal would then be to use secure bonding. This creates a link between just the bonded devices. Then hard coding the device uuid will not be needed. But I cant remember if bonding(pairing?) is supported by default on the to keyfob.

                     

                  Which to kit do you have? The one that looks like a remote? That comes with a CC debugger? I hate IAR BTW... :-) 

                  • 6. Re: Keyfob Receiver
                    user_453804851

                    I am using the Pioneer Kit.  But will be using my own board with the PRoC module later on.  I am hoping when I've got everything worked out to be able to use the SWD interface to just write in the fob address or maybe have a button on the PCB that will have it listen for the next button press it sees.

                    • 7. Re: Keyfob Receiver
                      user_10354431

                      Hi Morantz,

                         

                      No, i mean which TI kit.

                      • 8. Re: Keyfob Receiver
                        user_453804851

                        I am using the BLE Pioneer Kit.  I am trying to use it with an iTag which is available from China.  I have no control over the iTag firmware.  The chipset in use on it has no available documentation I could find, though it appears to have the debug port brought out on the pcb.

                           

                        That is why I need to do everything on the Pioneer Kit's side of things.  I have connected to the keyfob (iTag) with CySmart and know the service it is sending updates to once the button is pressed.  Most of this was stated in the OP but might not have been clear.

                           

                        I hope your having a great weekend!  I get to finish moving to a new home this weekend. Yeah!

                        • 9. Re: Keyfob Receiver
                          user_453804851

                          The PN for the Pioneer Kit is CY8CKIT-042-BLE

                          • 10. Re: Keyfob Receiver
                            user_14586677

                            Found this bit does not seem to be complete, 3431 part of the family ?

                               

                             

                               

                            http://www.datasheet4u.com/datasheet-pdf/Beken/BK3231/pdf.php?id=836719

                               

                             

                               

                            Regards, Dana.

                            1 of 1 people found this helpful