I just wrote this up the other day, so this is a simple copy+paste! For the app side, you would need to look at the documentation for iOS/Android respectively, we don’t have a mobile SDK yet, but will at some point. I could also give you access to the app source code, which is currently closed while I clean it up and try to make the SDK from it.
You will need to local compile to send data down to bluz, and you can use a local programmer (STLink or JLink) or you can compile locally and use ‘particle flash’ from the CLI to send code to bluz. If you are modifying the underlying firmware drivers, you will need to update both the system and user parts. If you need help with how to do this please let me know.
To send your own data to bluz, you can do the following:
Once you do that, you can now write data to our characteristic from any app. You will include a “header” on your data where the first byte is always 3 (which corresponds to the definition you made) and then the remaining data will get sent to your DataCallback function. You also always need to send a separate 2-byte data packet when you are done transmitting that is [0x03, 0x04]. That needs to be a separate write to the characteristic. If your data is larger than 512 bytes, you should also split it up so that you send your data with 0x03 appended to the front, then the trailing write with [0x03, 0x04] then do it again with your next chunk of data.
Please let me know if that makes sense or if you have any more questions. Again, I will add hooks to all of this in a future release so that the “app layer” can talk through this data channel as well, just haven’t gotten there yet.