Skip to content

Commit 2d03df3

Browse files
author
David Graeff
committed
Merge remote-tracking branch 'origin/master'
2 parents 83f85ff + b91a733 commit 2d03df3

File tree

2 files changed

+62
-1
lines changed

2 files changed

+62
-1
lines changed

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,21 @@ This project is not for the old eclipse based SDK! It depends on the
4747
support libraries (v13), additional support library extensions (v7.RecyclerView) and need at least android 4.2 (sdk version 17, released 13. Nov 2012). Parts of the app (import/export/backgrounds) are only usuable with Android 4.4 (DocumentProvider class).
4848

4949
### Plugin Development
50-
All you need to develop a plugin is described in detail at the [Plugin Developer Documentation](https://github.com/davidgraeff/Android-NetPowerctrl-Shared#plugin-developer-documentation).
50+
In ealier versions plugins via the android IPC were supported. This is no longer the case. Your app will be started by NetPowerCtrl via a Broadcast, from this point on, use the simpleUDP protocol for communication.
51+
All you need to develop a plugin is described in detail at the [Plugin Developer Documentation](https://github.com/davidgraeff/Android-NetPowerctrl/blob/master/doc/simpleudp.md). Sample implementations are available here: https://github.com/davidgraeff/esp8266_dev/tree/master/app_pc
5152

5253
### Authors
5354
* david.graeff(at)web_de
5455
* Some icons from http://www.clker.com/
5556

57+
### Used external libraries
58+
* com.github.rey5137:material:1.1.0 (Apache License, Version 2.0)
59+
* com.wefika:flowlayout:0.3.4 (Apache License, Version 2.0)
60+
* jp.wasabeef:recyclerview-animators:1.2.0@aar (Apache License, Version 2.0)
61+
* com.github.gabrielemariotti.changeloglib:library:1.5.2 (Apache License, Version 2.0)
62+
* ch.acra:acra:4.6.2 (Apache License, Version 2.0)
63+
* net.lingala.zip4j:zip4j:1.3.2 (Apache License, Version 2.0)
64+
* com.google.code.ndef-tools-for-android:ndeftools:1.2.4 (Apache License, Version 2.0)
65+
5666
### License
5767
Dual licensed: GPLv2+GPLv3

doc/simpleudp.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# SimpleUDP
2+
3+
## SimpleUDP Packet Format (Receive type)
4+
* All ascii based, two characters not allowed in names and ids: newline (\n) and tabulator (\t).
5+
6+
### General structure (lines are separated by newlines)
7+
Header (always SimpleUDP_info or SimpleUDP_info_ack or SimpleUDP_info_fail)
8+
DeviceUniqueID (often Mac address of peer)
9+
Name of device (english name of device, user may rename it within the app)
10+
Version string (no special formatting)
11+
List of actions (one action per line, action consists of multiple tokens)
12+
13+
If you send SimpleUDP_detect, you will receive a full SimpleUDP_info with all known actions. If
14+
you send a SimpleUDP_cmd, the peer will acknowledge with a SimpleUDP_info_ack where only the affected
15+
actions are listed.
16+
17+
### Structure of an action
18+
TYPE \t actionID string \t action name \t optional value
19+
20+
* **TYPE** is one of (STATELESS,TOGGLE,RANGE,NOTEXIST).
21+
* The **actionID** may be any string but have to be unique among all actions.
22+
* The **action name** can be any string as long as it does not contain \n and \t.
23+
* The value is only necessary if the type is TOGGLE or RANGE. If the Header is equal to SimpleUDP_info_fail
24+
the TYPE may be NOTEXIST if you requested a command on a non existing action.
25+
26+
Example packet:
27+
SimpleUDP_info\n
28+
11:22:33:44:55:66\n
29+
device_name\n
30+
1.0-2015.05.10\n
31+
STATELESS\tACTION1\tAction Name
32+
TOGGLE\tACTION2\tAction Name\t1
33+
34+
## SimpleUDP Packet Format (command type)
35+
* All ascii based, two characters not allowed in names and ids: newline (\n) and tabulator (\t).
36+
37+
### General structure (lines are separated by newlines)
38+
Header (always SimpleUDP_cmd)
39+
UniqueID (we use the android device unique id)
40+
CMD_TYPE \t actionID \t VALUE \t RANDOM_REQUEST_NO
41+
42+
* **CMD_TYPE** is one of (SET,TOGGLE,RENAME), the actionID has been received before and is known.
43+
* **VALUE**: if CMD_TYPE is SET,RENAME a value is necessary else just set it to 0.
44+
* **RANDOM_REQUEST_NO**: A random request number. This is for duplicate detection. The receiver has
45+
to check the current commands request number against the last ~3 requests and ignore (but still
46+
ack) the received but already executed command.
47+
48+
Example packet:
49+
SimpleUDP_cmd\n
50+
NFKAJELAFBAGAHD\n
51+
SET\tACTION2\t1

0 commit comments

Comments
 (0)