PSoC™ 4 Forum Discussions
Hello,
I came here again and need some help after multiples workarounds..
The goal is to command a device ( a motorized door) with smartphones.
The smartphone have to be bonded with the door to allow easy use of the phone application.
There is only 1 button on the door, and the Ble module in use is in 4.1. Today's most device use resolvable random adress so can't use whitlistening to discard not allowed device to connect.
To work around the 1 button problem without the whitelist (i use just work and have to allow connection with 1 button), i do things like that :
/**********************************************************
* GATT Events
***********************************************************/
case CYBLE_EVT_GATT_CONNECT_IND:
/* This event is received when device is connected over GATT level */
#ifdef PRINT_MESSAGE_LOG
UART_UartPutString("\n\r\tConnected_Ind \n\r");
#endif
connectionHandle = *(CYBLE_CONN_HANDLE_T *)eventParam;
break;
case CYBLE_EVT_GAP_DEVICE_CONNECTED:
/* This event is received when device is connected over GAP layer */
/* This flag is used in application to check connection status */
deviceConnected = TRUE;
CyBle_GapGetBondedDevicesList(&bondedDeviceList);
if (pairingAuth == TRUE) // button have been pressed (TRUE during 3 sec)
{
cyBle_authInfo.authErr = CYBLE_GAP_AUTH_ERROR_NONE;
}
else if ((bondedDeviceList.count >= 1) && (connectionHandle.bdHandle == 4))
{
cyBle_authInfo.authErr = CYBLE_GAP_AUTH_ERROR_NONE;
}
else if ((bondedDeviceList.count >= 2) && (connectionHandle.bdHandle == 3))
{
cyBle_authInfo.authErr = CYBLE_GAP_AUTH_ERROR_NONE;
}
else if ((bondedDeviceList.count >= 3) && (connectionHandle.bdHandle == 2))
{
cyBle_authInfo.authErr = CYBLE_GAP_AUTH_ERROR_NONE;
}
else if ((bondedDeviceList.count >= 4) && (connectionHandle.bdHandle == 1))
{
cyBle_authInfo.authErr = CYBLE_GAP_AUTH_ERROR_NONE;
}
else
{
cyBle_authInfo.authErr = CYBLE_GAP_AUTH_ERROR_PAIRING_NOT_SUPPORTED;
CyBle_GapDisconnect(connectionHandle.bdHandle);
}
break;
case CYBLE_EVT_GAP_DEVICE_DISCONNECTED:
/* This event is received when device is disconnected */
CyBle_GapGetBondedDevicesList(&bondedDeviceList);
/* bonded device remove "FIFO handle" */
if (bondedDeviceList.count == 4 )
{
CyBle_GapRemoveOldestDeviceFromBondedList();
//be sure to store it in flash
if((cyBle_pendingFlashWrite != 0u) &&
((UART_SpiUartGetTxBufferSize() + UART_GET_TX_FIFO_SR_VALID) == 0u))
{
if(CYBLE_ERROR_OK== CyBle_StoreBondingData(1u))
}
}
break;
It seems Ok to allow/discard the connection to a smartphone, with the input button :
If non bonded, and if bonded just by checking the bdHandle and the Bonded device count.
But my problem is that i want to automaticaly delete the oldest bonded device when the the bonded list is full to allow this new device to be bonded.
The problem is that it is not working, indeed CyBle_GapRemoveOldestDeviceFromBondedList(); does not update the bd.handle.
I would like that the bdHandle == 3 is now 4, 2 now 3, 1 now 2
bondedDeviceList.count is updated correctly so i just would like to "slide" the bdHandles number..
How can i go throught that, it seems not possible
We can't ask the users to delete all their smartphones if they want to add a new one.
Thanks for your help
Show LessPlease answer below.
The same question is written in English and Japanese.
・English
This connector is used by connecting the XRES terminal on the MinProg3 to the XRES terminal on the PSoC4100SP.
The XRES terminal on the PSoC 4100SP is for input only, but is the XRES terminal on the Miniprog3 for output only (Not bi-directional, no reset input)?
・Japanese
MinProg3のXRES端子とPSoC4100SPのXRES端子を接続し使用しております。
PSoC4100SPのXRES端子は入力専用端子ですが、
Miniprog3のXRES端子は出力専用端子(双方向ではない、リセット入力機能をもたない)でしょうか?
Regards
Show LessDears:
customer use PSOC as main controller,and they need to modify the SCB bandrate when running application
do we have the API can fit the requirement ?
Show LessHave any examples been created that use a curved metal overlay over a curved inductive sensor?
I’d like to modify a broom handle that can detect the presence of grip, regardless if the grip is wearing gloves or from an artificial limb.
Since a curved solid metal surface won’t deflect and return like a planar surface would, I’m considering a metal mesh over foam over inductive sensors.
Please let me know pros and cons of this approach.
I'm also interested in hearing of alternative approaches.
Greg
Show LessWe started developing Capacitive Fingerprint sensor module with CY8C4127LQI-BL483 chip, we have ADH make Capacitive FPsensor HF108 & supporting source code (mostly for LPC / STM MCU) and which is bit messed non documented, inteface is via SPI , i am not a professional developer so need help in converting the code to above chip, attaching the HF108 datasheet
Show LessHi
I see the picture from PSoC 4 CapSense Design Guide. It seems putting many vias on the ground plane. May I know what's the function of that? Is it necessary ? Thanks.
BR
Grace
Show Less
How to set psoc creator4.0 the tool box to code size optimize.
Hello,
I am trying to dynamically update the advertising packets sent by my PSoC 4 device in the "Central and Peripheral" project. I have seen the following thread:
Recommended method to update manufacturer data when NOT advertising
and have attempted to do this by changing the cyBle_discoveryModeInfo.advData->advData[] array before starting advertising. I have done this in the StackEventHandler's CYBLE_EVT_STACK_ON function:
/* Set adv data packet */
char deviceName[] = "12345678";
(cyBle_discoveryModeInfo.advData->advData)[3] = 0x09; //Set length
for(i=5; i<13; i++)
(cyBle_discoveryModeInfo.advData->advData) = deviceName[i-5];
cyBle_discoveryModeInfo.advData->advDataLen = 13;
CyBle_GappStartAdvertisement(CYBLE_ADVERTISING_FAST);
/* ------------------------- */
The issue I am having is that the advertising packet does not change, which I see by using the LightBlue app and looking at the device name. Interestingly, if I change the cyBle_discoveryModeInfo.r->respData array this way, it does change the response packet. However, I need to change the initial advertising packet as well. What am I doing wrong in this case?
Thank you very much.
Show LessHello,
I'm using a CYBLE-212006-1 module, I need to set the LE power in DUT mode to perform validation tests. I tried the HCI_VENDOR_SET_TX_PWR command but it always fails.
Can I use this command for the CYBLE-212006-1 module?
How can I control the continuous transmission power LE?
Regards
Cristian
Show Less