-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6d94e40
commit 6590d47
Showing
3 changed files
with
78 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<smartanthill.plugin name="ping" title="Ping" version="1.0"> | ||
|
||
<description>The plugin allows to indicate if device is on-line ("1" will be returned in response) and to mesure latency</description> | ||
|
||
<reply> | ||
<field name="ok" type="encoded-uint[max=1]" min="1" max="1" /> | ||
</reply> | ||
|
||
</smartanthill.plugin> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/******************************************************************************* | ||
Copyright (C) 2015 OLogN Technologies AG | ||
This program is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License version 2 as | ||
published by the Free Software Foundation. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License along | ||
with this program; if not, write to the Free Software Foundation, Inc., | ||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
*******************************************************************************/ | ||
|
||
#include "ping.h" | ||
|
||
uint8_t ping_plugin_handler_init( const void* plugin_config, void* plugin_state ) | ||
{ | ||
return 0; | ||
} | ||
|
||
uint8_t ping_plugin_handler( const void* plugin_config, void* plugin_state, parser_obj* command, MEMORY_HANDLE reply/*, WaitingFor* waiting_for*/, uint8_t first_byte ) | ||
{ | ||
zepto_response_to_request( reply ); | ||
zepto_write_uint8( reply, 1 ); // answer with "1", we are on-line! | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/******************************************************************************* | ||
Copyright (C) 2015 OLogN Technologies AG | ||
This program is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License version 2 as | ||
published by the Free Software Foundation. | ||
This program is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License along | ||
with this program; if not, write to the Free Software Foundation, Inc., | ||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
*******************************************************************************/ | ||
|
||
|
||
#if !defined __SA_PING_PLUGIN_H__ | ||
#define __SA_PING_PLUGIN_H__ | ||
|
||
#include "../../common/sa-common.h" | ||
#include "../../common/sa-data-types.h" | ||
|
||
typedef struct _PingPluginConfig | ||
{ | ||
|
||
} PingPluginConfig; | ||
|
||
typedef struct _PingPluginState | ||
{ | ||
|
||
} PingPluginState; | ||
|
||
uint8_t ping_plugin_handler_init( const void* plugin_config, void* plugin_state ); | ||
uint8_t ping_plugin_handler( const void* plugin_config, void* plugin_state, parser_obj* command, MEMORY_HANDLE reply/*, WaitingFor* waiting_for*/, uint8_t first_byte ); | ||
|
||
|
||
#endif // __SA_PING_PLUGIN_H__ |