Filter results by

Older Versions

Older API versions are available as a download. To view, extract the file and open the index.html file in a web browser.

artik_module.h File Reference

Module management definition. More...

#include "artik_types.h"
#include "artik_error.h"

Go to the source code of this file.

Data Structures

struct  artik_api_version
 Structure defining the API version information. More...
 
struct  artik_api_module
 Structure defining the elements of a module. More...
 

Macros

#define MAX_VERSION_STRING   16
 Maximum length of version string.
 
#define MAX_MODULE_NAME   32
 Maximum length of module names string.
 
#define MAX_PLATFORM_NAME   64
 Maximum length of platform names string.
 
#define MAX_BT_ADDR   17
 Maximum length of bluetooth mac address string.
 
#define MAX_WIFI_ADDR   17
 Maximum length of wifi mac address string.
 
#define MAX_PLATFORM_SN   17
 Maximum length of platform serial number string.
 
#define MAX_PLATFORM_MANUFACT   7
 Maximum length of platform manufacturer string.
 
#define MAX_PLATFORM_MODELNUM   17
 Maximum length of platform model number string.
 

Typedefs

typedef void * artik_module_ops
 Type for module operations.
 

Enumerations

enum  artik_module_id_t {
  ARTIK_MODULE_LOG = 0, ARTIK_MODULE_LOOP, ARTIK_MODULE_GPIO, ARTIK_MODULE_I2C,
  ARTIK_MODULE_SERIAL, ARTIK_MODULE_PWM, ARTIK_MODULE_ADC, ARTIK_MODULE_HTTP,
  ARTIK_MODULE_CLOUD, ARTIK_MODULE_WIFI, ARTIK_MODULE_MEDIA, ARTIK_MODULE_TIME,
  ARTIK_MODULE_SECURITY, ARTIK_MODULE_SPI, ARTIK_MODULE_BLUETOOTH, ARTIK_MODULE_SENSOR,
  ARTIK_MODULE_ZIGBEE, ARTIK_MODULE_NETWORK, ARTIK_MODULE_WEBSOCKET, ARTIK_MODULE_LWM2M,
  ARTIK_MODULE_MQTT
}
 IDs of all the available modules.
 

Functions

artik_error artik_get_api_version (artik_api_version *version)
 Get API version. More...
 
artik_module_ops artik_request_api_module (const char *name)
 Get API module operations structure. More...
 
artik_error artik_release_api_module (const artik_module_ops module)
 Release API module operations structure. More...
 
int artik_get_platform (void)
 Get platform ID. More...
 
artik_error artik_get_platform_name (char *name)
 Get platform name. More...
 
artik_error artik_get_available_modules (artik_api_module **modules, int *num)
 Get modules available for the platform. More...
 
bool artik_is_module_available (artik_module_id_t id)
 Check if a specific module is available for the platform. More...
 
char * artik_get_device_info (void)
 Get device information. More...
 
artik_error artik_get_bt_mac_address (char *addr)
 Get platform Bluetooth MAC address. More...
 
artik_error artik_get_wifi_mac_address (char *addr)
 Get platform Wifi MAC address. More...
 
artik_error artik_get_platform_serial_number (char *sn)
 Get platform serial number. More...
 
artik_error artik_get_platform_manufacturer (char *manu)
 Get platform manufacturer. More...
 
artik_error artik_get_platform_uptime (int64_t *uptime)
 Get platform uptime. More...
 
artik_error artik_get_platform_model_number (char *modelnum)
 Get platform model number. More...
 

Detailed Description

Definitions and functions for managing the various modules exposed by the API

Definition in file artik_module.h.

Function Documentation

artik_error artik_get_api_version ( artik_api_version version)
Parameters
[out]versionString returned by the function. Must be preallocated for a size at least MAX_VERSION_STRING bytes long.
Returns
S_OK always
Examples:
module_test/artik_module_test.c.
artik_error artik_get_available_modules ( artik_api_module **  modules,
int *  num 
)
Parameters
[out]modulesPointer to an array of module definition structures for each module available for the platform. This array does not need to be preallocated, it points to a static array.
[out]numNumber of modules structures available in the array. This value shall be used to browse through the modules array.
Returns
S_OK on success, error code otherwise
Examples:
module_test/artik_module_test.c.
artik_error artik_get_bt_mac_address ( char *  addr)
Parameters
[out]Stringreturned by the function with the bluetooth mac address of the platform the API has been built for. Must be preallocated for a size at least MAX_BT_ADDR+1 bytes long.
Returns
S_OK on success, error code otherwise
Examples:
module_test/artik_module_test.c.
char* artik_get_device_info ( void  )
Returns
JSON string filled up by the function and containing information about the current device. String is allocated by the function and must be freed by the calling function.
Examples:
module_test/artik_module_test.c.
artik_error artik_get_platform_manufacturer ( char *  manu)
Parameters
[out]Stringreturned by the function with the manu of the platform the API has been built for. Must be preallocated for a size at least MAX_PLATFORM_MANUFACT+1 bytes long.
Returns
S_OK on success, error code otherwise
Examples:
module_test/artik_module_test.c.
artik_error artik_get_platform_model_number ( char *  modelnum)
Parameters
[out]Stringreturned by the function with the model number of the platform the API has been built for. Must be preallocated for a size at least MAX_PLATFORM_MODELNUM+1 bytes long.
Returns
S_OK on success, error code otherwise
Examples:
module_test/artik_module_test.c.
artik_error artik_get_platform_name ( char *  name)
Parameters
[out]nameString returned by the function with the name of the platform the API has been built for. Must be preallocated for a size at least MAX_PLATFORM_NAME bytes long.
Returns
on success, error code otherwise
Examples:
module_test/artik_module_test.c.
artik_error artik_get_platform_serial_number ( char *  sn)
Parameters
[out]Stringreturned by the function with the sn of the platform the API has been built for. Must be preallocated for a size at least MAX_PLATFORM_SN+1 bytes long.
Returns
S_OK on success, error code otherwise
Examples:
module_test/artik_module_test.c.
artik_error artik_get_platform_uptime ( int64_t *  uptime)
Parameters
[out]Integer(64 bits) Number of seconds elapsed since the board was powered up.
Returns
S_OK on success, error code otherwise
Examples:
module_test/artik_module_test.c.
artik_error artik_get_wifi_mac_address ( char *  addr)
Parameters
[out]Stringreturned by the function with the wifi mac address of the platform the API has been built for. Must be preallocated for a size at least MAX_WIFI_ADDR+1 bytes long.
Returns
S_OK on success, error code otherwise
Examples:
module_test/artik_module_test.c.
artik_error artik_release_api_module ( const artik_module_ops  module)
Parameters
[in]modulePointer on the address of the module symbol to release.
Returns
S_OK on success, otherwise error code.
Examples:
adc_test/artik_adc_test.c, bluetooth_test/artik_bluetooth_test.c, bluetooth_test/artik_bluetooth_test_advertiser.c, bluetooth_test/artik_bluetooth_test_agent.c, bluetooth_test/artik_bluetooth_test_avrcp.c, bluetooth_test/artik_bluetooth_test_ftp.c, bluetooth_test/artik_bluetooth_test_gatt_client.c, bluetooth_test/artik_bluetooth_test_gatt_server.c, bluetooth_test/artik_bluetooth_test_nap.c, bluetooth_test/artik_bluetooth_test_panu.c, bluetooth_test/artik_bluetooth_test_spp.c, bluetooth_test/artik_bluetooth_test_spp_client.c, cloud_test/artik_cloud_test.c, gpio_test/artik_gpio_test.c, http_test/artik_http_openssl_test.c, http_test/artik_http_test.c, i2c_test/artik_i2c_test.c, loop_test/artik_loop_test.c, media_test/artik_media_test.c, mqtt_test/artik_mqtt_cloud_test.c, network_test/artik_dhcp_client_test.c, network_test/artik_dhcp_server_test.c, network_test/artik_network_test.c, pwm_test/artik_pwm_test.c, security_test/artik_security_test.c, sensor_test/artik_sensor_test.c, serial_test/artik_serial_test.c, spi_test/artik_spi_test.c, time_test/artik_time_test.c, websocket_test/artik_websocket_client_test.c, websocket_test/artik_websocket_cloud_test.c, websocket_test/artik_websocket_test.c, wifi_test/artik_wifi_ap_test.c, wifi_test/artik_wifi_test.c, zigbee_test/artik_zigbee_cli.c, zigbee_test/artik_zigbee_test.c, and zigbee_test/artik_zigbee_test_common.c.
artik_module_ops artik_request_api_module ( const char *  name)
Parameters
[in]nameString containing the name of the module to operate on.
Returns
a pointer to a structure containing the module operations.
Examples:
adc_test/artik_adc_test.c, bluetooth_test/artik_bluetooth_test.c, bluetooth_test/artik_bluetooth_test_advertiser.c, bluetooth_test/artik_bluetooth_test_agent.c, bluetooth_test/artik_bluetooth_test_avrcp.c, bluetooth_test/artik_bluetooth_test_ftp.c, bluetooth_test/artik_bluetooth_test_gatt_client.c, bluetooth_test/artik_bluetooth_test_gatt_server.c, bluetooth_test/artik_bluetooth_test_nap.c, bluetooth_test/artik_bluetooth_test_panu.c, bluetooth_test/artik_bluetooth_test_spp.c, bluetooth_test/artik_bluetooth_test_spp_client.c, cloud_test/artik_cloud_test.c, gpio_test/artik_gpio_test.c, http_test/artik_http_openssl_test.c, http_test/artik_http_test.c, i2c_test/artik_i2c_test.c, loop_test/artik_loop_test.c, lwm2m_test/artik_lwm2m_test_client.c, media_test/artik_media_test.c, mqtt_test/artik_mqtt_cloud_test.c, network_test/artik_dhcp_client_test.c, network_test/artik_dhcp_server_test.c, network_test/artik_network_test.c, pwm_test/artik_pwm_test.c, security_test/artik_security_test.c, sensor_test/artik_sensor_test.c, serial_test/artik_serial_test.c, spi_test/artik_spi_test.c, time_test/artik_time_test.c, websocket_test/artik_websocket_client_test.c, websocket_test/artik_websocket_cloud_test.c, websocket_test/artik_websocket_test.c, wifi_test/artik_wifi_ap_test.c, wifi_test/artik_wifi_test.c, zigbee_test/artik_zigbee_cli.c, zigbee_test/artik_zigbee_test.c, and zigbee_test/artik_zigbee_test_common.c.
Last updated on: