PSoC™ 4 Forum Discussions
Hello,
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 LessHello,
I'm facing some issues while interfacing with an E-Ink display. Its SPI(slave) based display module with an additional pins for the status.
I've edited the SCB SPI master example, but unable to read status response. Attached the my example app and also data sheet of the display module for your reference. I think I'm missing something stupid. Can you please help me?
Btw, I did successfully interfaced the display using our existing BLE chip.
Thanks & Regards,
Sharan
Show LessI have a PRoC (CYBLE-022001-00) project with two significant problems:
1. Interrogation frequently gets hung with the state machine apparently getting stuck on CYBLE_EVT_HCI_STATUS
I am tracking the BLE event / event param on an LCD during connect. I see it cycle through 44:4, 4:4, then 4c:4 when successful. But when it gets 'stuck', the central (an iOS or Android device) is unable to discover services and the state machine is on 4:4, which I believe is CYBLE_EVT_HCI_STATUS with an error code. Why would this be, and how can I make it recoverable?
I can easily replicate it by connecting, staying connected for a few seconds to make sure discovery completes and characteristics are being read and written to, then disconnecting. I wait a bit to ensure it returns to advertising (26:0) then reconnect. About every 3rd or 4th time it will get hung up like this.
2. Following disconnect, it does not always properly detect disconnect and re-start advertising. I have even had to power cycle the hardware to get it working again.
Has anyone else run into these issues? I do have current support tickets with Cypress as well, so I will report back if I hear anything from them.
Cheers all!
Show LessHi,
I wonder how much connection event packet proc ble can send. I did not find this information in bluetooth document. This amount of data varies with the connection event size?
Thank you
Show LessI've been through the SFlash example and has success in applying the method to an application with small amounts of information, usually not even a rows worth, but now I'm looking at storing more information that's more dynamic in certain areas. In the example, the writing function (WriteUserSFlashRow) accepts a row number and a 32-bit array pointer as parameters. I'm don't really understand the inner-workings of the function, but was wondering if there were checks to not have to rewrite bytes in the row that weren't changed, or if there was a way to change/write to a specific byte(s) within a given row, or if you can only write an entire row at a time. If it makes any difference, I wouldn't want to write all 128u if I just want to change a few in a given row.
Show LessHi everyone,
For a project I am using a PSoC4BLE. But there is no USB available with PSoC4 familly so I will use a CY7C65213:
http://www.cypress.com/file/139881/download
I want to be sure, I just need to connect RX and TX of the chip to the PSoC right? There are no CTS and RTS available on UART PSoC?
Thank you
Show Less