Hi there,
Hi there,
Hello,
-120 means Operation already in progress, are you calling this anywhere else in your code?
You can check the error codes here.
Best regards,
Karl
Hello,
-120 means Operation already in progress, are you calling this anywhere else in your code?
You can check the error codes here.
Best regards,
Karl
Thanks for your quick reply, Karl!
Yes, I call bt_le_adv_start() twice. First, for a HID device and second, for a Nordic UART service. My application must advertise both simultaneously. If I'm using the API incorrectly, how should I use it?
On the referenced page, EINPROGRESS is 119, not -120. How so?
mlac said:Thanks for your quick reply, Karl!
No problem at all, I am happy to help! :)
mlac said:First, for a HID device and second, for a Nordic UART service. My application must advertise both simultaneously. If I'm using the API incorrectly, how should I use it?
Could you elaborate what you mean by this? Your device will have both services either way, regardless of the contents of the advertising packet, so you only need to start one advertising to make it available for connection by a central device.
Are you here perhaps talking about multiple advertising sets - that you sometimes wish to advertise the UUID only of the HID service, and sometimes only of the NUS service?
mlac said:On the referenced page, EINPROGRESS is 119, not -120. How so?
The error code you saw was -120, which is EALREADY, but you are correct that EINPROGRESS is 119.
Best regards,
Karl
I have device A and device B. Device A is a HID keyboard and a NUS server. Device B is a NUS client. Device A must be connected to a host computer as a keyboard, and it must be simultaneously connected to a NUS client. Therefore, I thought I should make device A advertise both as a HID keyboard and a NUS server. Please advise how I should implement the advertisement of device A.
As for the error codes, the referenced file contains positive values, while the API provided a negative value. Is this a convention, so should I always look up the related positive error code?
Hello,
mlac said:I have device A and device B. Device A is a HID keyboard and a NUS server. Device B is a NUS client. Device A must be connected to a host computer as a keyboard, and it must be simultaneously connected to a NUS client. Therefore, I thought I should make device A advertise both as a HID keyboard and a NUS server. Please advise how I should implement the advertisement of device A.
Do you need Device A to advertise both the HID and NUS services for Device B to be able to find it, or could Device A just advertise its name, or some other identifier, which both device B and the computer could use to filter and connect to?
mlac said:As for the error codes, the referenced file contains positive values, while the API provided a negative value. Is this a convention, so should I always look up the related positive error code?
That's correct - within Linux negative values are usually function result codes, while positive values are function return values, and so when error codes are returned they would for instance be written
return -EBUSY
Best regards,
Karl
My knowledge of BLE advertising requirements and filtering possibilities is limited. I only know that both the host computer and device B must be able to simultaneously connect to device A.
Device A and B both use the nRF52840. The host device can be any computer, phone, or tablet.