Smart Bluetooth Forum Discussions
During i call bleprofile_WriteHandle(UINT16 hdl, BLEPROFILE_DB_PDU *p_pdu), i find that the BLEPROFILE_DB_PDU structure as following:
// GATT_PDU
typedef PACKED struct
{
UINT8 len;
UINT8 header;
UINT8 pdu[LEATT_ATT_MTU-1];
} BLEPROFILE_DB_PDU;
The LEATT_ATT_MTU value is 23, so the max length of data i can update the characteristic is 22 bytes, if i define a characteristic whose value length is more than 22 bytes, how can i update using bleprofile_WriteHandle()? Although BLE spec requires the MTU of characteristic is 22, but i find if i define one characteristic value length more than 22, it will split into 2 packets and send to host.
Show LessHello,
I am having some issues understand some concepts of the data transfer in BLE.
Basically, what I want to do is to transfer several KBs of persistent data to a client, in a reliable fashion.
So from what I understood I should use the bleprofile_sendIndication function.
But I have trouble understand the role of the GATT DB in this case. The prototype of bleprofile_sendIndication is the following
void bleprofile_sendIndication(HANDLE, DATA, LENGTH, CALLBACK)
Why do I need to specify the HANDLE? The function is going to store DATA into the GATT DB, then send the indication to ask the client to read the recently stored value? Or is the DATA is directly sent through the network?
The CALLBACK is triggered when the server receives the ACK?
An unrelated question: How do I write more than 23B of data into the GATT from the server? The bleprofile_writeHandle function takes a PDU struct which takes 23 bytes of data maximum.
Thank you for your insights.
Show LessHello,
I wonder if there is any way to get RSSI during connection session? I can see we can get RSSI (at master side) passed in advertisement report HCIULP_ADV_PACKET_REPORT_WDATA.rssi. Now, I want to get this reading at slave side, while master does not advertise ( it just scans and connects to advertising slaves).
Thanks,
Ayman
Show LessWe come out a question there, if we put many hello-sensors in one big interior area
but "Don't connect" any with 1 client master which only receives slave devices' broadcast data
and firmware put all sensor data in broadcast field and send it via broadcast channel.
If so, in 20-byte length format, we can all replace all bytes to replace with our sensor data?
Is BT client can get correct ADV or it doesn't work.
to sum up with this mechanism,
- all sensors (slave devices) put sensor data in ADV and send it out; client master can get
many ADV of different area sensor data.
- if so, client can still call other API to get MAC addr or coz broadcast format is wrong,
even free APP of handset can not scan it correctly?
Hi,
Is there any deep sleep mode document? I met a question when use the rtc_sample App demo.
it will restart after wakeup from sleep in this demo. how can I manage do not restart when wake up from sleep. below code is what I use.
#ifdef RTC_SAMPLE_ENTER_DEEP_SLEEP_AND_ENABLE_TIMED_WAKE
{
static UINT32 num_timeouts_since_boot = 0;
// Demo going into deep sleep with wake after 5s.
if (num_timeouts_since_boot++ >= 10)
{
// If its been ~10s of ADV, configure timed wake and
// enter deep sleep right now.
ble_trace0("Entering deep sleep.");
gpio_configurePin(0, 0, 0x100, 0);
// Configure the low power manager to enter deep sleep.
devLpmConfig.disconnectedLowPowerMode = DEV_LPM_DISC_LOW_POWER_MODES_HID_OFF;
// Configure the wake time in mS.
devLpmConfig.wakeFromHidoffInMs = 5000;
// Configure the reference clock to use.
// Use the external 32k.
devLpmConfig.wakeFromHidoffRefClk = HID_OFF_TIMED_WAKE_CLK_SRC_32KHZ;
gpio_configurePin(0, 0, 0x100, 0);
// Enter deep-sleep now. Will not return.
devlpm_enterLowPowerMode();
}
}
#endif
Thanks,
Lei
Show LessHi
The return value of gpio_getPinInput is BYTE.
In short, is the range of the return value from 0 to 255 by default like Analog Input, in't it?
How can I use GPIO as Digital Input?
I want to get the return value of a GPIO as HIGH and LOW.
Then, can I use a GPIO pin as interrupt pin and digital input?
I configured like following:
------------------------------------------------
#define GPIO_PIN 25
#define GPIO_SETTING GPIO_PIN GPIO_INPUT | GPIO_INIT_LOW | GPIO_INT | GPIO_INTERRUPT_ENABLE
gpio_configurePin(GPIO_PIN/16, GPIO_PIN%16, GPIO_EN_INT_LEVEL_HIGH | GPIO_PULL_DOWN | GPIO_INPUT_ENABLE, GPIO_PIN_OUTPUT_LOW);
-------------------------------------------------
After I make my board enter Deep Sleep, I use this pin to wake it up.
I want my board to enter Deep Sleep with the exception that the state of GPIO_PIN is HIGH.
In short, I want to implement like following:
While GPIO_PIN is HIGH, my board works.
While GPIO_PIN is LOW, my board is Deep Sleep mode.
How should I do for realizing this function?
By the way,
I have been using GPIO_PIN(25) as a interrupt pin to wake my board up.
If the current setting, while my borad works, the GPIO interruption happens every time (every 6.5ms)?
Should I use GPIO_EN_INT_RISING_EDGE?
Is RISING_EDGE robust to noise?
Best regards
Show LessHi
I'm using P4 pin as an interruption pin to wake up from deep sleep.
When a rising edge is detected, the system wakes up from deep sleep.
However, I think that it doesn't wake up immediately with the tag3 reference board. I think it is the same in the case of the other interruption option, e.g. falling edge.
Does this work correctly? If so, please tell me how much time takes to do it.
Best regards
Show LessMy application invokes HIDoff to go into a deep sleep, and works fine on the BCM20732S.
When I try to enter HIDoff mode, at first it seems to work - the current draw drops to near 0.
But then, about 6 seconds later, the current rises to 2mA and stays there. The chip does not wake up at this point - it still appears to be sleeping, and will wake up later from an interrupt just fine. But it is drawing a lot of power.
I am analyzing this using a power meter that logs the current draw over time.
I've attached screen shots with annotations.
In the first image you can see the device running, then there is a burst of current when it enters HIDoff, and then it is off.
Then, after about 6 seconds, something happens that leaves it running at a fairly high level.
The second image shows a continuation where I then press a button to wake up the device and it indeed wakes up and resumes normal operation.
The identical board design and firmware works fine with the 20732S.
Any ideas?
Show LessHi,
There appears to be two interfaces for pulling off HIDOFF; devlpm_enterLowPowerMode() and bleprofile_PrepareHidOff().
Are there any particular use cases where one of the two is favored over the other?
In our application, some characteristic needs data size of 512 bytes. Could you let me know when this Designer will support this? It looks like the designer is supporting data length only up to 253 bytes in the database.
Show Less