-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgps.cpp
More file actions
47 lines (41 loc) · 1.06 KB
/
gps.cpp
File metadata and controls
47 lines (41 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/**************************************************************************
* Copyright (C), AirM2M Tech. Co., Ltd.
*
* Name: gps.cpp
* Author: panjun
* Version: V0.1
* Date: 2016/09/13
*
* Description:
* Global Positioning System(GPS).
* History:
* panjun 16/09/13 Initially create file.
**************************************************************************/
#include "stdafx.h"
#include "lua.hpp"
#include "platform.h"
#include "platform_conf.h"
#include "platform_gps.h"
// gpscore.open()
static int l_gps_open(lua_State *L) {
lua_pushinteger(L, platform_gps_open());
return 1;
}
// gpscore.close()
static int l_gps_close(lua_State *L) {
lua_pushinteger(L, platform_gps_close());
return 1;
}
#define MIN_OPT_LEVEL 2
// Module function map
const luaL_Reg gpscore_map[] =
{
{"open", l_gps_open},
{"close", l_gps_close},
{ NULL, NULL }
};
LUALIB_API int luaopen_gpscore( lua_State *L )
{
luaL_register( L, AUXLIB_GPSCORE, gpscore_map );
return 1;
}