{"action":"opened","issue":{"url":"https://api.github.com/repos/adafruit/Adafruit_BluefruitLE_Firmware/issues/22","repository_url":"https://api.github.com/repos/adafruit/Adafruit_BluefruitLE_Firmware","labels_url":"https://api.github.com/repos/adafruit/Adafruit_BluefruitLE_Firmware/issues/22/labels{/name}","comments_url":"https://api.github.com/repos/adafruit/Adafruit_BluefruitLE_Firmware/issues/22/comments","events_url":"https://api.github.com/repos/adafruit/Adafruit_BluefruitLE_Firmware/issues/22/events","html_url":"https://github.com/adafruit/Adafruit_BluefruitLE_Firmware/issues/22","id":308740276,"number":22,"title":"Error sending floats as 4 bytes: too many bytes sent.","user":{"login":"wrieger","id":37815942,"avatar_url":"https://avatars1.githubusercontent.com/u/37815942?v=4","gravatar_id":"","url":"https://api.github.com/users/wrieger","html_url":"https://github.com/wrieger","followers_url":"https://api.github.com/users/wrieger/followers","following_url":"https://api.github.com/users/wrieger/following{/other_user}","gists_url":"https://api.github.com/users/wrieger/gists{/gist_id}","starred_url":"https://api.github.com/users/wrieger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wrieger/subscriptions","organizations_url":"https://api.github.com/users/wrieger/orgs","repos_url":"https://api.github.com/users/wrieger/repos","events_url":"https://api.github.com/users/wrieger/events{/privacy}","received_events_url":"https://api.github.com/users/wrieger/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-26T21:22:27Z","updated_at":"2018-03-26T21:22:27Z","closed_at":null,"author_association":"NONE","body":"I have a sketch that works fine on version 6.7, however when I update to 7.x or 8.0 too many bytes (and the wrong bytes) are added to my characteristic. I am converting a float to 4 bytes and adding them to the characteristic. For some values of \"Chromium\"  the code still works on the newer firmware, but about 10% of of the value are sent as 8 bytes instead of 4. Serial monitor indicates only 4 bytes (though they are not the correct 4 bytes) are being send but a sniffer shows otherwise.  I'm at a loss to what may have changed between versions to cause this. See my code below:\r\n\r\n union u {\r\n  float f;\r\n  uint8_t s[4];};\r\n\r\n  u both;\r\n\r\n  float Chromium;\r\nChromium = 0.26 + 0.0001 * random(0, 10);\r\n  uint32_t index = CrVal;\r\n  both.f = Chromium;\r\n  \r\n  ble.print(\"AT+GATTCHAR=\");\r\n  ble.print(index);\r\n  ble.print( \",\");\r\n  ble.print(both.s[3],HEX);\r\n  ble.print(\"-\");\r\n  ble.print(both.s[2],HEX);\r\n  ble.print(\"-\");\r\n  ble.print(both.s[1],HEX);\r\n  ble.print(\"-\");\r\n  ble.println(both.s[0],HEX); "}}
{"actor":{"display_login":"wrieger"}}