MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / parseProperties

Method parseProperties

tools/bles2gatt.js:912–939  ·  view source on GitHub ↗
(properties)

Source from the content-addressed store, hash-verified

910 file.line("");
911 }
912 parseProperties(properties) {
913 let props = [];
914 properties.forEach(p => {
915 switch(p.trim()) {
916 case "read":
917 props.push("QAPI_BLE_GATT_CHARACTERISTIC_PROPERTIES_READ");
918 break;
919 case "write":
920 props.push("QAPI_BLE_GATT_CHARACTERISTIC_PROPERTIES_WRITE");
921 break;
922 case "writeNoResponse":
923 props.push("QAPI_BLE_GATT_CHARACTERISTIC_PROPERTIES_WRITE_WITHOUT_RESPONSE");
924 break;
925 case "notify":
926 props.push("QAPI_BLE_GATT_CHARACTERISTIC_PROPERTIES_NOTIFY");
927 break;
928 case "indicate":
929 props.push("QAPI_BLE_GATT_CHARACTERISTIC_PROPERTIES_INDICATE");
930 break;
931 case "extended":
932 props.push("QAPI_BLE_GATT_CHARACTERISTIC_PROPERTIES_EXTENDED_PROPERTIES");
933 break;
934 default:
935 throw new Error("unknown property");
936 }
937 });
938 return props.join('|');
939 }
940 parsePermissions(permissions) {
941 let perms = [];
942 let readPerms = 0;

Callers 1

generateMethod · 0.95

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected