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?
1 of 1 people found this helpful
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
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.
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!
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... :-)
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.
No, i mean which TI kit.
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!
The PN for the Pioneer Kit is CY8CKIT-042-BLE