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
Go to the documentation of this file.
1 /*
2  *
3  * Copyright 2017 Samsung Electronics All Rights Reserved.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing,
12  * software distributed under the License is distributed on an
13  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
14  * either express or implied. See the License for the specific
15  * language governing permissions and limitations under the License.
16  *
17  */
18 
19 #ifndef INCLUDE_ARTIK_MODULE_H_
20 #define INCLUDE_ARTIK_MODULE_H_
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
26 #include "artik_types.h"
27 #include "artik_error.h"
28 
42 #define MAX_VERSION_STRING 16
43 
47 #define MAX_MODULE_NAME 32
48 
52 #define MAX_PLATFORM_NAME 64
53 
57 #define MAX_BT_ADDR 17
58 
62 #define MAX_WIFI_ADDR 17
63 
67 #define MAX_PLATFORM_SN 17
68 
72 #define MAX_PLATFORM_MANUFACT 7
73 
77 #define MAX_PLATFORM_MODELNUM 17
78 
82  typedef void *artik_module_ops;
83 
87  typedef enum {
88  ARTIK_MODULE_LOG = 0,
89  ARTIK_MODULE_LOOP,
90  ARTIK_MODULE_GPIO,
91  ARTIK_MODULE_I2C,
92  ARTIK_MODULE_SERIAL,
93  ARTIK_MODULE_PWM,
94  ARTIK_MODULE_ADC,
95  ARTIK_MODULE_HTTP,
96  ARTIK_MODULE_CLOUD,
97  ARTIK_MODULE_WIFI,
98  ARTIK_MODULE_MEDIA,
99  ARTIK_MODULE_TIME,
100  ARTIK_MODULE_SECURITY,
101  ARTIK_MODULE_SPI,
102  ARTIK_MODULE_BLUETOOTH,
103  ARTIK_MODULE_SENSOR,
104  ARTIK_MODULE_ZIGBEE,
105  ARTIK_MODULE_NETWORK,
106  ARTIK_MODULE_WEBSOCKET,
107  ARTIK_MODULE_LWM2M,
108  ARTIK_MODULE_MQTT
110 
114  typedef struct {
118  unsigned int major;
122  unsigned int minor;
126  unsigned int patch;
130  char version[MAX_VERSION_STRING];
132 
136  typedef struct {
140  artik_module_id_t id;
144  char *name;
148  char *object;
150 
161 
170  artik_module_ops artik_request_api_module(const char *name);
171 
180  artik_error artik_release_api_module(const artik_module_ops module);
181 
187  int artik_get_platform(void);
188 
200 
215  int *num);
216 
224  bool artik_is_module_available(artik_module_id_t id);
225 
234  char *artik_get_device_info(void);
235 
247 
259 
271 
283 
292  artik_error artik_get_platform_uptime(int64_t *uptime);
293 
305 
306 #ifdef __cplusplus
307 }
308 #endif
309 #endif /* INCLUDE_ARTIK_MODULE_H_ */
unsigned int major
Major version number.
Definition: artik_module.h:118
void * artik_module_ops
Type for module operations.
Definition: artik_module.h:82
artik_error artik_get_platform_uptime(int64_t *uptime)
Get platform uptime.
char * name
Module name string.
Definition: artik_module.h:144
unsigned int minor
Minor version number.
Definition: artik_module.h:122
Custom types.
bool artik_is_module_available(artik_module_id_t id)
Check if a specific module is available for the platform.
artik_module_id_t
IDs of all the available modules.
Definition: artik_module.h:87
Structure defining the elements of a module.
Definition: artik_module.h:136
artik_error artik_get_available_modules(artik_api_module **modules, int *num)
Get modules available for the platform.
#define MAX_VERSION_STRING
Maximum length of version string.
Definition: artik_module.h:42
artik_error artik_get_platform_manufacturer(char *manu)
Get platform manufacturer.
int artik_error
Error type.
Definition: artik_error.h:35
artik_error artik_get_platform_name(char *name)
Get platform name.
artik_error artik_get_bt_mac_address(char *addr)
Get platform Bluetooth MAC address.
unsigned int patch
Patch version number.
Definition: artik_module.h:126
artik_error artik_get_api_version(artik_api_version *version)
Get API version.
int artik_get_platform(void)
Get platform ID.
artik_error artik_get_wifi_mac_address(char *addr)
Get platform Wifi MAC address.
char * object
Object name where the module is in.
Definition: artik_module.h:148
artik_error artik_release_api_module(const artik_module_ops module)
Release API module operations structure.
artik_error artik_get_platform_model_number(char *modelnum)
Get platform model number.
artik_error artik_get_platform_serial_number(char *sn)
Get platform serial number.
artik_module_id_t id
Module ID.
Definition: artik_module.h:140
Structure defining the API version information.
Definition: artik_module.h:114
char * artik_get_device_info(void)
Get device information.
Error codes.
artik_module_ops artik_request_api_module(const char *name)
Get API module operations structure.
Last updated on: