PSoC™ 4 Forum Discussions
I'm running into a very strange issue when trying to write some values to GATT. Basically I have a linked list of Events. I'm trying to run through the entire list and send each value to my smartphone.
What's weird:
My ble device will only send 10 notification calls. For instance, the output on my smartphone for a single event is the timestamp, a user code, and userID. It looks like this:
2007-03-01T13:00:20 VS 2d97f036a1T13G21Jm0
So, if I try to have more say 4 events, the output should look like this:
2007-03-01T13:00:20 VS 2d97f036a1T13G21Jm0
2007-03-01T13:00:20 VS 2d97f036a1T13G21Jm1
2007-03-01T13:00:20 VS 2d97f036a1T13G21Jm2
2007-03-01T13:00:20 VS 2d97f036a1T13G21Jm3
However all that I ever receive on my smartphone is this:
2007-03-01T13:00:20 VS 2d97f036a1T13G21Jm0
2007-03-01T13:00:20 VS 2d97f036a1T13G21Jm1
2007-03-01T13:00:20 VS 2d97f036a1T13G21Jm2
2007-03-01T13:00:20
Here is my function that loops through my linked list and send the data to a function to be printed:
/**
Print out all the currently recorded events.
*/
void printEvents() {
UART_UartPutString("printing events");
// Get the first item of our linked list
struct Event* temp = front;
// Counter to load and make sure we are getting
// through our whole linked list.
int counter = 0;
// Run through the linked list. I print out all
// the values of temp to ensure that each item
// is being fully cycled through. This does
// correctly print all the data out to UART.
while(temp != NULL) {
// Update our counter
counter++;
// Print out all the data to UART for verification
UART_UartPutString("||");
UART_UartPutString(temp->time);
UART_UartPutString(temp->name);
UART_UartPutString(temp->userId);
UART_UartPutString("||");
// Send our event to the smartphone
printEvent(temp);
// move to next item in list
temp = temp->next;
}
// Convert our counter to something we can print to UART
char* str = malloc(16);
snprintf(str, 16, "%d", counter);
// This correctly prints out 4 which it should be...
UART_UartPutString("counter = ");
UART_UartPutString(str);
free(str);
UART_UartPutString("done printing");
// Our terminting value so app knows it can start parsing data.
// This is never reached if we have more than 3 events in the queue.
sendValueToGATT((uint8 *)"---", sizeof("---"));
}
So pretty straight forward. In the code above, all of the data from the linked list is sent and printed in UART correctly. Thus I know the entire list is being run through. Here is my printEvent
function:
/**
Prints out a single event. A starting bit and ending bit will also be sent.
@param event A pointer to the Event that needs to be send.
*/
void printEvent(struct Event *event) {
sendValueToGATT((uint8 *)&event->time, sizeof(event->time));
sendValueToGATT((uint8 *)&event->name, sizeof(event->name));
sendValueToGATT((uint8 *)&event->userId, sizeof(event->userId));
}
And here is my sendValueToGATT
function:
/**
Sends a given value over the GATT profile to the connected device.
@param value A uint8 casted value to be sent
@param size The size of the value being passed. Usually aquired by using `sizeof`.
*/
void sendValueToGATT(uint8* value, uint16 size) {
CYBLE_GATTS_HANDLE_VALUE_NTF_T tempHandle3;
tempHandle3.attrHandle = CYBLE_LEDCAPSENSE_CAPSENSE_CHAR_HANDLE;
tempHandle3.value.val = value;
tempHandle3.value.len = size;
CyBle_GattsWriteAttributeValue(&tempHandle3,0,&cyBle_connHandle,CYBLE_GATT_DB_LOCALLY_INITIATED );
CyBle_GattsNotification(cyBle_connHandle,&tempHandle3);
}
I really have no idea why only 10 transaction max are taking place?? Is it some type of time threshold?
Show LessI'm running into an issue where I believe that I'm overflowing the BLE stack with notify events. I can't seem to find any documentation of if the BLE stack is processed and empty after every CyBle_ProcessEvents()
call.
I have a function that looks like this:
while(temp != NULL) {
if (CyBle_GattGetBusStatus() == CYBLE_STACK_STATE_FREE) {
// This methods writes data to the GATT profile
printEvent(temp);
temp = temp->next;
}
}
So my understanding is that the only time my printEvent()
function will be called only when the BLE stack is free....
However, after a few runs through this I start getting CYBLE_INVALID_OPERATION
error. This is leading me to believe that the stack is overflowing somehow....
This question is working off of this one: http://www.cypress.com/forum/psoc-4-ble/extremely-weird-error-when-writing-gatt-notify#comment-366046
Show LessWhat is the input tolerance of the OVT pins P5.0 and P5.1 on CYBLE-012011-00?
I can't seem to find an exact value in any of the datasheets.
I would like to connect one of the OVT pins through a series resistor with adequate value to the voltage source (+5V) of a USB port in order to identify whether the device is connected to a USB port or not.
Thank you in advance.
Show LessAs a client, scanning an unbonded peripheral, is there a method to resolve a random private resolvable address, then to bond, but store the public address of the peripheral in the bonded data? I'm working with both devices from scratch, and thought, for a method of no in/no out authentication, the peripheral can create an RPA using a key hard-coded in both devices, then, if the RPA scanned by the central is resolvable using said key, the central knows to connect and bond with the peripheral. After bonding they will disconnect and the peripheral will advertise using the Public address. Sort of the reverse of the 100 Days Privacy examble. Thank you.
Show LessHi, just got the CY8CKIT-041-40XX kit that have a 4000S device.
I'm trying to do some basic logic gates with the SmartIO component, i'm using two input pins and a output pin, i would like to have pull-ups in both input pins but the configuration window i got an error:
"Use of drive modes which are not High Impedance with hardware-routed input requires a port adapter, but the selected device does not have one."
I kind of do not understand the error, the devices does not have pull-ups, or the pull-ups are not available for pins that have hw connection option enabled?
Thanks in advance
-Carlos
Show LessHello,
can me sombody help, please...?
When I call the function to connect: CyBle_GapDisconnect(), the first ble module started to connecting. The second ble is switched off.
The first module ist in the state: CYBLE_STATE_CONNECTING a try to connect to second module (its switched off). My problem is,
that first module is try to connect about 30s. I need to decrease this the time (for example 10s), but where?
The setting in the connection parameters: min time is set to 7.5ms, max to 30ms, supervision timeout: 1000ms.
Thank you
Show Lesssoftware platform :WICED3.6; hardware platform:BCM43438; OS:FreeRtos
I use function "wiced_bt_l2cap_update_ble_conn_params" to update conn params on slave device after connection is up.
How do I know whether these params work? Because master device may refuse the update request.
Show LessI added the Bootloadable component, removed the LCD component, and changed the Baud rate to 31250 (standard for MIDI), edited main.c to create an endless loop transmitting 3 characters every second. Programming is successful (takes about 10-15 seconds). But Verify fails with cannot read data from device. The debugger cannot find the target device.
Show LessHello, I have a CY8CKIT-049 42xx board and I was wondering if It is possible to use it as a hid. If so do you know where I could find documentation on it? Thanks!
Show LessHello,I'm trying to send a sin signal and display it on CySmart, I changed the Heart Sensor example but I only receive 0 and I don't know why. I also try to send an ADC data and a string and display on TeraTerm but I'm not able to make it work.
Can someone help me ? I'm here for more informations
(I'm using PSoC Creator 3.3 and the CY8CKIT-042_BLE)
Show Less