@@ -9,6 +9,41 @@ Sign up at the Chirp [Developer Hub](https://developers.chirp.io/sign-up)
99Copy and paste your Chirp app key, secret and chosen configuration into the
1010[ example application] ( https://github.com/chirp/chirp-connect-flutter/tree/master/chirpsdk/example )
1111
12+ ## Configuration
13+
14+ It is recommended to use the example code as a template, but in short, configuring the
15+ SDK is as simple as initialising with your credentials and chosen configuration, and starting
16+ the audio processing.
17+
18+ await ChirpSDK.init(_appKey, _appSecret);
19+ await ChirpSDK.setConfig(_appConfig);
20+ await ChirpSDK.start();
21+
22+ ## Sending
23+
24+ Chirp SDKs accept data as an array of bytes, creating a versatile interface for all kinds of data.
25+ However in most cases, Chirp is used to send a short identifier. Here is an example of how to send
26+ a short string with the Chirp SDK.
27+
28+ String identifier = "hello";
29+ var payload = new Uint8List.fromList(identifier.codeUnits);
30+ await ChirpSDK.send(payload);
31+
32+ It is worth noting here that the send method will not block until the entire payload has been sent,
33+ but just as long as it takes to pass the message to the SDK. Please use the onSent callback for this
34+ purpose.
35+
36+ ## Receiving
37+
38+ To receive data you can listen for received events like so
39+
40+ ChirpSDK.onReceived.listen((e) {
41+ String identifier = new String.fromCharCodes(e.payload);
42+ });
43+
44+ A received event includes the ` payload ` and the ` channel ` for multichannel configurations.
45+ There are several other callbacks available which are illustrated in the example.
46+
1247## Contributions
1348
1449This project aims to be a community driven project and is open to contributions.
0 commit comments