diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2015-02-28 09:49:31 +0100 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2015-02-28 09:49:31 +0100 |
commit | ecdaa9c8112746ea2c843523358db253600b1074 (patch) | |
tree | ff9c721b0c216597ecf658ce78f7226b96b4ff25 | |
parent | 58776682e2bf94043dd79d0131c69947ef27dcae (diff) | |
download | trygvisio_soil_moisture-ecdaa9c8112746ea2c843523358db253600b1074.tar.gz trygvisio_soil_moisture-ecdaa9c8112746ea2c843523358db253600b1074.tar.bz2 trygvisio_soil_moisture-ecdaa9c8112746ea2c843523358db253600b1074.tar.xz trygvisio_soil_moisture-ecdaa9c8112746ea2c843523358db253600b1074.zip |
o When sending a notification, also update the data in the local GATT
server so it is easier to implement synchronous clients.
-rw-r--r-- | trygvisio_soil_moisture.ino | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/trygvisio_soil_moisture.ino b/trygvisio_soil_moisture.ino index 388dd8a..560aef7 100644 --- a/trygvisio_soil_moisture.ino +++ b/trygvisio_soil_moisture.ino @@ -400,6 +400,9 @@ void notify_soil_moisture(const struct sm_res& res, uint8_t body_len) { // Serial.print(F("pipe available=")); // Serial.println(available, DEC); + // This should probably be an explicit part of the API, but for now it makes it easier to implement a synchronous interface. + lib_aci_set_local_data(&aci_state, pipe_set, (uint8_t *)&res, len); + if (available && aci_state.data_credit_available > 0) { boolean sent = lib_aci_send_data(pipe_tx, data, len); if (sent) { |