node-wio-link
A node.js client library for using the Wio Link API.
Table Of Contents
Documentation
Official Documentation: http://seeed-studio.github.io/Wio_Link/
Built-In Grove APIs: https://github.com/Seeed-Studio/Wio_Link/wiki/Built-in-Grove-APIs
All methods return a promise, which either resolves to the data received, or rejects with an error.
User Management
// Creates a new user account.wioClientuser // Changes the password of an existing account.wioClientuser // Retrieve the password of an existing account.wioClientuser // Log in to the server with the given credentials.wioClientuser
Node Management
// Creates a new node.wioClientnodeManagement // List the nodes associated with the user.wioClientnodeManagement // Rename an existing node.wioClientnodeManagement // Delete an existing node.wioClientnodeManagement
Grove Driver
// Retrieve all of the grove drivers' information.wioClientgroveDriver // Retrieve the status of last driver scanning.wioClientgroveDriver
Boards/Platform
// List all of the supported boards.wioClientboards
Single Node
// Lists all of the available resources on a node.wioClientnode // Read the property of a Grove module.wioClientnode // Write to a Grove module.wioClientnode // Put the node to sleep.wioClientnode // Retrieve the API reference page from the node.wioClientnode // Trigger the OTA process for the node.wioClientnode // Track the OTA status of the node.wioClientnode // Get the configuration of the node.wioClientnode // Change the data exchange server for the node.wioClientnode
Coding on the fly
// Upload a user's logic block to a node.wioClientcotf // Download a user's logic block from a node.wioClientcotf // Get the value of a variable on the node.wioClientcotf // Set the value of a variable on the node.wioClientcotf // Call a function on the node.wioClientcotf
Custom API calls
In case there's a few APIs that aren't covered in this library, a bunch of custom functions are available to use. They will return the response received from making the call.
// Perform a custom HEAD requestwioClientcustom // Perform a custom GET requestwioClientcustom // Perform a custom POST requestwioClientcustom // Perform a custom PUT requestwioClientcustom // Perform a custom DELETE requestwioClientcustom
Examples
Using Promises
// serverLocation can be 'us' or 'cn'const wioClient = serverLocation; wioClientnode ;
Using Async/Await
// serverLocation can be 'us' or 'cn'const wioClient = serverLocation; { try const airQuality = await wioClientnode; console; catch error console; };