PSoC™ 4 Forum Discussions
text.format{('custom.tabs.no.results')}
The current device name in my Gap Settings is "SN01234567890123456" But an iOS app I have written in swift is scanning and getting instead the device name "sensor ID not set up yet" which is thought I changed when I entered "SN01234567890123456" in the device name window of the Gap Settings page. I've searched both my c code running on the pioneer kit and my swift code running on the iOS device for "sensor ID not set up yet" and can't find it in either place. I've also looked at the name characteristics with CySmart and can't find it.
But here's the weird thing, both the CySmart on my pc and CySmart on the iOS device scan and receive the correct device name "SN01234567890123456" So the culprit must be my swift code. But I can't find any obvious problems.
Any idea what's going on?
Show LessI am using a custom Bluetooth service to write Device Information Service attributes like device name and serial number from a smartphone to our connected IoT product. When I restart the device, the values are gone, so I need to store them in flash and set the attributes on every startup:
CyBle_DissSetCharacteristicValue(CYBLE_DIS_SERIAL_NUMBER, sizeof(serial_number), (uint8_t *)serial_number); CyBle_GasSetCharacteristicValue(CYBLE_GAS_DEVICE_NAME, sizeof(device_name), (uint8_t *)device_name); CyBle_GapSetLocalName(device_name); CyBle_GapUpdateAdvData(cyBle_discoveryModeInfo.advData, cyBle_discoveryModeInfo.scanRspData);
Is there any way to save that storage space and set the device name and serial number permanently at the time of receive? I wasn't able to find anything in the BLE CSD component's datasheet.
Show LessHi folks,
I am currently working on a touch application which should use absolute coordinates.
How can I change the relative coordinates into absolute coordinates in USBFS?
I have read through the datasheet component but it either doesn't say or I've missed it.
Thanks
Show LessHello,
i am trying to read an external Flash over SPI.
On oszilloscope looks data well, but my variable a and b is wrong.
Code:
SPIM_SpiUartWriteTxData(0x03); // Readcomand
dummy = SPIM_SpiUartReadRxData();
SPIM_SpiUartWriteTxData(A_high); // Adress
dummy = SPIM_SpiUartReadRxData();
SPIM_SpiUartWriteTxData(A_mid); // Adress
dummy = SPIM_SpiUartReadRxData();
SPIM_SpiUartWriteTxData(A_low); // Adress
dummy = SPIM_SpiUartReadRxData();
SPIM_SpiUartWriteTxData(0x00); // Dummy
a = SPIM_SpiUartReadRxData();
SPIM_SpiUartWriteTxData(0x00); // Dummy
b = SPIM_SpiUartReadRxData();
I use SS Pin automatic. And a read 16 bit value (2 times dummy 0x00 at mosi pin)
My problem is, a und b is wrong.
Somebody know, was can the problem be? Component "SPIM" has default settings. Master Mode, CPOL 0
Thanks
Best regards
Alex
Show LessI am testing OOB keys with bonding, using a PSoC 4 BLE as the central and a PRoC BLE as the peripheral. For initial testing the key is just statically declared in each project, this removes the key transmission as a source of my problem.
When I initially program both the central and peripheral, they authenticate using the OOB data and store their bonding data. If I reset or power cycle either the central or peripheral they authenticate with the stored bonding data. It works very well.
If I reprogram the central, the peripheral asks for authentication and the central provides the OOB data then stores the bonding data.
The problem comes when I reprogram the peripheral. Then the central tries to authenticate with the stored bonding data and the peripheral rejects it. I get a CYBLE_EVT_GAP_AUTH_FAILED event with a passed in parameter of CYBLE_GAP_AUTH_ERROR_INSUFFICIENT_ENCRYPTION_KEY_SIZE.
I've tried
- CyBle_GapRemoveBondedDevice, and
- CyBle_GapRemoveBondedDevice, followed by CyBle_StoreBondingData
Then I always do:
CyBle_GapSetOobData(m_connHandle.bdHandle, CYBLE_GAP_OOB_ENABLE, securityKey, NULL, NULL);
CyBle_GapAuthReq(m_connHandle.bdHandle, &cyBle_authInfo);
No matter what I do the authorization fails with the insufficient encryption key size until I reprogram the central (clearing out the bonding data in flash).
Show LessHello,
I am using PSoC4 Ble as a server to send temperature data to client. I have created custom profile in which one service has been created and characteristic for the temperature. I have used Cyble_GattsWriteAttributeValue() to write the values to the gatt database. But it's not working. I have tested this on Windows CySmart application. I could connect to the psoc module, but i was unable to discover the attributes .
Can anyone please suggest any corrections to be made in this code?
Thank you in advance.
-Neeraj
void Stack_Handler(uint32 eventCode, void *event_Param)
{
switch(eventCode)
{
case CYBLE_EVT_STACK_ON:
case CYBLE_EVT_GAP_DEVICE_DISCONNECTED:
CyBle_GappStartAdvertisement(CYBLE_ADVERTISING_FAST);
break;
case CYBLE_EVT_GATT_CONNECT_IND:
cyBle_connHandle = *(CYBLE_CONN_HANDLE_T *)event_Param ;
break;
}
}
void updateGattData(uint8 temp, uint16 attrH)
{
CYBLE_GATT_HANDLE_VALUE_PAIR_T *envdata;
CYBLE_GATT_ERR_CODE_T result;
envdata->attrHandle = attrH;
envdata->value.val = &temp;
envdata->value.len= 2;
envdata->value.actualLen=2;
result = CyBle_GattsWriteAttributeValue(envdata,0,&cyBle_connHandle,CYBLE_GATT_DB_LOCALLY_INITIATED);
}
int main()
{
int16 temp1, temp2,temp1_mV,temp2_mV, hum, hum_mV;
uint8 temperature;
CyGlobalIntEnable; /* Enable global interrupts. */
CyBle_Start(Stack_Handler);
ADC_SAR_Seq_1_Start();
ADC_SAR_Seq_1_StartConvert();
for(;;)
{
if( ADC_SAR_Seq_1_IsEndConversion(ADC_SAR_Seq_1_WAIT_FOR_RESULT))
{
temp1 =ADC_SAR_Seq_1_GetResult16(0);
temp2 =ADC_SAR_Seq_1_GetResult16(1);
hum = ADC_SAR_Seq_1_GetResult16(2);
temp1_mV = ADC_SAR_Seq_1_CountsTo_mVolts(0,temp1);
temp2_mV = ADC_SAR_Seq_1_CountsTo_mVolts(1,temp2);
hum_mV = ADC_SAR_Seq_1_CountsTo_mVolts(2,hum);
temperature= (temp1_mV - temp2_mV);
}
CyBle_ProcessEvents();
CyDelay(500);
updateGattData(temperature,CYBLE_ENVSENSING_TEMPERATURE_CHAR_HANDLE);
}
}
Hi All,
I am working with PSoC 4200 chip, i coud not find any example for UART reception in interrupt mode.
i did not want to poll for data // ch = UART_UartGetChar();
anyone have idea on this?
Thanks,
Ashok R
Show LessHello folks,
I try to build a little terminal with the rc522 rfid reader chip ( on a tiny module from ebay ) and a OLED Display ( SSD1306 also SPI bus but in UDB mode because no chip select wire ) and of course the MIGHTY PSOC 4 ^.^
My problem:
I have a tiny Arduino due which works as expected. RFID reader hooked up OLED hooked up, Software written and it works.
So i have a definite working Reader and Display.
I hooked up the Display to the PSOC and started to write the Software to control it. Long Story many failures but finaly it works now. Also i got it managed to work with some GFX functions like circles Sprites and and and ( also a little Font ).
But the reader refuses to work. I even dont know if the communication works as expected because in the rx buffer are always values which are not expected. 0xE0 mostly.
Has anybody managed to get this reader working with a SPI_SCB component ???
I make a try with good old static BitBanging but mhm I dont know what happens.
Show LessHello PSoC Community,
I have issue with reading the value using characterstic UUID, when I try to read I am getting an error Attribute Handle not found.
If anyone know what is the event handler for the READ USING CHARACTERISTIC UUID, please let me know.
Thanks
Show LessHi All
I apologize for being active on forum after a very long time.
Anyways, I am currently working in a direction to test I2C Master and Slave in a single PSoC4 - 049 42xx Prototyping Kit. The function that I want is:
1. Send Command from from Master to Slave.
2. Send response of the command from Slave to Master.
I have a single kit. So is there any possibility of testing 2 I2Cs of same PSoC4 with setting one as master and one as slave?
Thank you in advance.
- Shaunak Agastya Vyas
Show Less