Closed mitchjs closed 4 months ago
Sure you can do that. Works just as you would expect, create a client instance and a server instance and give it a go.
ok, when i get this remote deally in my hand, ill scan it and see what services it offers...
thanks!!!
Is there any example for this operation ? I cannot access to the client services of the central through peripheral.
I'm also trying to get this to work and I'm encountering a crash. My operation is the client starts scanning and then I try to setup the server after. And I immediately get a crash.
` static inline ble_npl_error_t ble_npl_mutex_pend(struct ble_npl_mutex *mu, ble_npl_time_t timeout) { return npl_freertos_mutex_pend(mu, timeout); }
rc = ble_npl_mutex_pend(&ble_hs_mutex, 0xffffffff);
ble_hs_lock_nested();
/ STATIC / NimBLEServer* NimBLEDevice::createServer() { if(NimBLEDevice::m_pServer == nullptr) { NimBLEDevice::m_pServer = new NimBLEServer(); ble_gatts_reset(); ble_svc_gap_init(); ble_svc_gatt_init(); }
return m_pServer;
} // createServer
ble_gatts_reset();
`
That's the backtrace. Seems to fail on the createServer call. Any advice? @h2zero
Update on this - I think I got this working. You need to create the server first before trying to create the client. I was doing it the other way around.
This should be resolved via 32c213a
@h2zero , my existing project working great, then the user asked me if they could add a BLE remote(physical device) to it, i dont got the remote YET, but im guessing its a server probably even BLE HID. i always see "Client or Server" never both options
thanks mitch