Skip to content

Instantly share code, notes, and snippets.

@ChristopherJohnston
Last active September 16, 2024 10:06
Show Gist options
  • Save ChristopherJohnston/ebe05ff8e6a8f21b5995ab14ddb8377d to your computer and use it in GitHub Desktop.
Save ChristopherJohnston/ebe05ff8e6a8f21b5995ab14ddb8377d to your computer and use it in GitHub Desktop.
MOTU AVB Controller App Settings Encoding
import 'dart:convert';
final settingsJson = {
//"deviceUrl": "http://localhost:8888/datastore",
"deviceUrl": "https://motu-avb-server.web.app/datastore",
"auxList": [0, 2, 4, 6, 8, 10, 12],
"groupList": [0, 2, 4],
"groupInputList": {
"0": [24, 25, 26, 27, 28, 29, 30, 31, 32, 34],
"2": [],
"4": []
},
"auxInputList": {
"chan": {
"0": [0, 1, 2, 3, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 23, 35],
"2": [0, 1, 2, 3, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 23, 35],
"4": [0, 1, 2, 3, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 23, 35],
"6": [0, 1, 2, 3, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 23, 35],
"8": [0, 1, 2, 3, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 23, 35],
"10": [0, 1, 2, 3, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 23, 35],
"12": [0, 1, 2, 3, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 23, 35]
},
"group": {
"0": [0],
"2": [0],
"4": [0],
"6": [0],
"8": [0],
"10": [0],
"12": [0]
}
}
};
void main() {
const url = "https://motu-avb-controller.web.app/#/aux/0";
final jsonStr = utf8.encode(jsonEncode(settingsJson));
final encodedBytes = base64Encode(jsonStr);
print("$url?settings=$encodedBytes");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment