This is the SDK for AssemblyScript programming language for SORACOM Orbit.
Please use it to generate WASM modules for data transformation processing in SORACOM Orbit from AssemblyScript language source code.
TypeScript and AssemblyScript are used to compile your program with SDK. Please make sure to install the following node modules in advance.
- dependencies
- orbit-sdk-assemblyscript ( e.g., "soracom/orbit-sdk-assemblyscript" )
- devDependencies
- @assemblyscript/loader ( Tested with version 0.18.32 )
- @types/node
- assemblyscript ( Tested with version 0.18.32 )
- typescript
Please add some scripts to package.json
, as shown below.
{
"scripts": {
"build": "asc assembly/index.ts --binaryFile build/soralet.wasm --sourceMap --debug --runtime stub --use abort=~lib/orbit-sdk-assemblyscript/index/abort",
"build:optimized": "asc assembly/index.ts --binaryFile build/soralet-optimized.wasm --sourceMap --optimize --runtime stub --use abort=~lib/orbit-sdk-assemblyscript/index/abort"
}
}
Once npm run build
or npm run build:optimized
is executed, soralet.wasm
or soralet-optimized.wasm
is generated in the build
directory.
Please upload either one as a Soralet.
soralet.wasm
is for debugging, and soralet-optimized.wasm
is for release.
Please import the functions SDK provides, as shown below.
import {
getInputBuffer,
getInputBufferAsString,
getTagValue,
getSourceValue,
getLocation,
getTimestamp,
getUserdata,
setOutputJSON,
log,
} from "orbit-sdk-assemblyscript";
Please refer to Soracom Orbit SDK Reference.
For more specific usage, please refer to each sample in the examples
directory.
The examples
directory in this repository includes the following samples:
-
A sample for geofencing based on data sent from GPS Multi Unit SORACOM Edition (Battery Built-in Type).
-
A sample that adds auxiliary information to the data sent from the SORACOM LTE-M Button series (SORACOM LTE-M Button Plus and SORACOM LTE-M Button for Enterprise) and transmits it.
This SDK is released under the MIT License. For details, please see the LICENSE file.