Author Topic: Subscribe and event receiving data  (Read 339 times)

Offline gn_torino

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
Subscribe and event receiving data
« on: September 30, 2021, 06:38:51 PM »
Hello,
thank for your support.
We are evaluating you library for BT LE commuication with a GATT communication with some characteristics.
We have been able to discover all services, characteristics and descriptors.
We have 4 characteristics :one Notifiable, one indicable, one write with no responde, one writable.

It has no security settings and it seems I have been able to subscribe to characteristics as I receive the result value equal to 0.
Anyway after that, the characteristic changed event is neves issued.

Following the online help I tried to call sequentially both methods
subscribe
writeClientConfiguration
but I receive an error on the writeClientConfiguration 0x51004

If I call just writeClientConfiguration i receive the error 0x51004.

The event handler is set before the BT connection. Is there any constrain on when setting the event handler?

Am I missing something in my settings ?
Thanks
Best regards
G.

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3628
  • Karma: 1000
    • Wireless Communication Libraries
Re: Subscribe and event receiving data
« Reply #1 on: September 30, 2021, 06:58:01 PM »
Hello,

The error code 0x00051004 is WCL_E_BLUETOOTH_LE_INSUFFICIENT_AUTHENTICATION (Attribute server does not support the request received from the client.) https://www.btframework.com/errors.htm

It looks like your device requires authentication and may be pairing.

Offline gn_torino

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
Re: Subscribe and event receiving data
« Reply #2 on: September 30, 2021, 07:24:36 PM »
OK, thanks a lot.
If I pair with my OS (Windows) it works.
To pairing it with the method , should I call RemotePairing before of after the connect Method ?

If I use both I receive a connected and disconnected event one just after the other and the device seems remaining disconnected.

Thanks
Best regards
G.

Offline Mike Petrichenko

  • Bluetooth Framework Developer
  • Administrator
  • Hero Member
  • *****
  • Posts: 3628
  • Karma: 1000
    • Wireless Communication Libraries
Re: Subscribe and event receiving data
« Reply #3 on: September 30, 2021, 07:27:45 PM »
Yes, use RemotePair method to pair with your device. With lot of devices it is better to pair after connect. However, some device may require pairing before connect. So it depends on your device. Try pair after connect first and if it does not work, try pair before connect. Also, if your device has random MAC do not forget to unpair after disconnect and pair again when next time connect to device because its MAC changed.

 

Sitemap 1 2 3 4 5 6 7 8 9 10 11 12 13