You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+72-1Lines changed: 72 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,7 +35,7 @@ go install ./cmd/golemu
35
35
golemu --help
36
36
```
37
37
38
-
**Note:** Make sure `$GOPATH/bin` or `$HOME/go/bin` is in your `PATH` environment variable to use the `golemu` command directly.
38
+
**Note:** Make sure `$GOBIN`, `$GOPATH/bin` or `$HOME/go/bin` is in your `PATH` environment variable to use the `golemu` command directly. When `$GOBIN` is set, go installs `golemu` there.
39
39
40
40
## Build Locally
41
41
@@ -57,12 +57,58 @@ golemu has 3 commands (`client`, `server`, and `simulator`) to operate in differ
57
57
58
58
## LLRP client mode(`golemu client`)
59
59
60
+
```console
61
+
% golemu client --help
62
+
usage: golemu client
63
+
64
+
Run as an LLRP client; connect to an LLRP server and receive events (test-only).
65
+
66
+
Flags:
67
+
--help Show context-sensitive help (also try --help-long
68
+
and --help-man).
69
+
-v, --debug Enable debug mode.
70
+
--initialMessageID=1000 The initial messageID to start from.
71
+
--initialKeepaliveID=80000
72
+
The initial keepaliveID to start from.
73
+
-a, --ip=0.0.0.0 LLRP listening address.
74
+
-k, --keepalive=0 LLRP Keepalive interval.
75
+
-p, --port=5084 LLRP listening port.
76
+
-m, --pdu=1500 The maximum size of LLRP PDU.
77
+
-i, --reportInterval=10000 The interval of ROAccessReport in ms. Pseudo
78
+
ROReport spec option.
79
+
--version Show application version.
80
+
```
81
+
60
82
The client mode establishes an LLRP connection with an LLRP server (interrogator). Retry connecting to the server until it becomes online and keep receiving the events until the server closes the connection.
61
83
62
84
This command is test-only; which means it only displays the number of events (TAG REPORT DATA parameter) in each received RO ACCESS REPORT message.
63
85
64
86
## LLRP server mode(`golemu server`)
65
87
88
+
```console
89
+
% golemu server --help
90
+
usage: golemu server [<flags>]
91
+
92
+
Run as an LLRP tag stream server.
93
+
94
+
Flags:
95
+
--help Show context-sensitive help (also try --help-long
96
+
and --help-man).
97
+
-v, --debug Enable debug mode.
98
+
--initialMessageID=1000 The initial messageID to start from.
99
+
--initialKeepaliveID=80000
100
+
The initial keepaliveID to start from.
101
+
-a, --ip=0.0.0.0 LLRP listening address.
102
+
-k, --keepalive=0 LLRP Keepalive interval.
103
+
-p, --port=5084 LLRP listening port.
104
+
-m, --pdu=1500 The maximum size of LLRP PDU.
105
+
-i, --reportInterval=10000 The interval of ROAccessReport in ms. Pseudo
106
+
ROReport spec option.
107
+
--version Show application version.
108
+
--apiPort=3000 The port for the API endpoint.
109
+
-f, --file="tags.gob" The file containing Tag data.
110
+
```
111
+
66
112
The server mode first loads tags from a file (`tags.gob` by default) to produce a "virtual inventory of tags." The gob encoded file speeds up the loading process of tags since it is critical for the emulation of hundreds to thousands of tags.
67
113
68
114
Follow the steps below to generate a gob file; however, this is at the moment _very ugly_ and as golemu and [go-llrp](https://github.com/iomz/go-llrp) only takes PC bits and EPC data parameter to represent a tag. I may come up with another way or format to load up tags to golemu in the future.
@@ -101,6 +147,31 @@ The resulting gob file of the above example (just 1 SGTIN-96 tag) should look li
--help Show context-sensitive help (also try --help-long
158
+
and --help-man).
159
+
-v, --debug Enable debug mode.
160
+
--initialMessageID=1000 The initial messageID to start from.
161
+
--initialKeepaliveID=80000
162
+
The initial keepaliveID to start from.
163
+
-a, --ip=0.0.0.0 LLRP listening address.
164
+
-k, --keepalive=0 LLRP Keepalive interval.
165
+
-p, --port=5084 LLRP listening port.
166
+
-m, --pdu=1500 The maximum size of LLRP PDU.
167
+
-i, --reportInterval=10000 The interval of ROAccessReport in ms. Pseudo
168
+
ROReport spec option.
169
+
--version Show application version.
170
+
171
+
Args:
172
+
<simulationDir> The directory contains tags for each event cycle.
173
+
```
174
+
104
175
The simulator mode also operates as an LLRP server (RFID interrogator) – the only difference is that it iterates through generated gob files in a directory. This mode is intended to simulate a batch of event cycles designed to evaluate specific situations.
105
176
106
177
One gob file for one event cycle. golemu iterates the file by the file names in ascending order. Suppose there are 3 files (`00.gob`, `01.gob`, and `02.gob` for example) in `/path/to/sim`,
0 commit comments