Signal Station - Java
Download sample source code
This client project hosted by Github. You can download("clone") the client by following command:
# Replace $WORKSPACE with your actual workspace path
$ cd $WORKSPACE
$ git clone [email protected]:zoyi/demo-station-java.gitAuthentication
Set your authentication info by refer each code of demo classes:
opts.query = "user_email=" + "[YOUR_EMAIL]" +
"&user_token=" + "[YOUR_AUTHENTICATION_TOKEN]" +
"&shop_id=" + "[SHOP_ID]";
Request authentication tokenYou can retrieve
authentication_tokenby calling Sing-In API.
See: API Authentication (en)
Response
When connection has established properly, the signals scanned by ZOYI Square will be mirrored from server. If you need signals in the past before connection, you have to use REST API.
[
{
"square_mac": "f4fd2b102606",
"ts": 1438324960285,
"device_id": "e89fa04fea3056ce59bd94d0684ecbe2",
"rssi": -64
},
{
"square_mac": "f4fd2b102606",
"ts": 1438325027784,
"device_id": "e89fa04fea3056ce59bd94d0684ecbe2",
"rssi": -59
},
...
]ShopMirroringDemo
For mirror all of the signals from shop.
ShopMonitoringDemo
For mirror certain signals by MAC address. Unlike ShopMirroringDemo example, it will accepts only signals from shop which shop ID specified.
You have to set opts.query values like below:
opts.query = "user_email=" + "" +
"&user_token=" + "" +
"&shop_id=" + "1";Once connection established, you can emit the MAC addresses which willing to accept.
socket.emit("join", "ff0ca23fc455");Emit MAC address as lower case, except semi colon.
SquareMonitoringDemo
For mirror certain signals by MAC address. Unlike ShopMonitoringDemo example, it will accepts only signals from square which MAC address specified.
You have to set opts.query values like below:
opts.query = "user_email=" + "" +
"&user_token=" + "" +
"&square_mac=" + "f4fd2b100000";Once connection established, you can emit the MAC addresses which willing to accept.
socket.emit("join", "ff0ca23fc455");Emit MAC address as lower case, except semi colon.
Updated 8 months ago
