LazGem 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/LazGem/ioctl.rb +21 -0
- data/lib/LazGem/version.rb +1 -1
- data/sample/sample_rx.rb +5 -0
- data/sample/sample_tx.rb +6 -1
- data/sample/sample_tx64.rb +5 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f7a8d7dac05ffcb6c0bf725000a26eaf203f6359
|
4
|
+
data.tar.gz: 1b0ef77cc92e7f31995676a9f0d485ded976f998
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 93c879be719de4f2fdfbda59ce9a740dd6c2153f1ab60d94473f5cc124d3ce14291dc979d1e47a245ed84f5fe7168be3a591c71393e05a102e097b3eb20a452a
|
7
|
+
data.tar.gz: 448b5ea510c8f318920fc97859108ddb969d5ee1bde3dd5a99ad3646d04511fc101a4f6bbe51a0f3d58a3fd5af00440e2496d368037bf56cba3c24a6f3315bd6
|
data/lib/LazGem/ioctl.rb
CHANGED
@@ -61,6 +61,11 @@ class LazGem::Device
|
|
61
61
|
IOCTL_SET_PROMISCUOUS= IOCTL_PARAM+0x35
|
62
62
|
IOCTL_SET_ACK_REQ= IOCTL_PARAM+0x37
|
63
63
|
IOCTL_SET_BROADCAST= IOCTL_PARAM+0x39
|
64
|
+
IOCTL_SET_EACK_DATA= IOCTL_PARAM+0x3B
|
65
|
+
IOCTL_SET_EACK_LEN= IOCTL_PARAM+0x3D
|
66
|
+
IOCTL_SET_EACK_ENB= IOCTL_PARAM+0x3F
|
67
|
+
IOCTL_GET_EACK= IOCTL_PARAM+0x40
|
68
|
+
IOCTL_SET_ACK_INTERVAL= IOCTL_PARAM+0x43
|
64
69
|
IOCTL_RF= 0x2000
|
65
70
|
IOCTL_RF_READ= IOCTL_RF+0x0000
|
66
71
|
IOCTL_RF_WRITE= IOCTL_RF+0x8000
|
@@ -115,6 +120,22 @@ class LazGem::Device
|
|
115
120
|
def setBroadcastEnb(on)
|
116
121
|
ret = @@device_wr.ioctl(IOCTL_SET_BROADCAST,on)
|
117
122
|
end
|
123
|
+
def setEnhanceAck(data)
|
124
|
+
ret = @@device_wr.ioctl(IOCTL_SET_EACK_ENB,0)
|
125
|
+
ret = @@device_wr.ioctl(IOCTL_SET_EACK_LEN,data.length)
|
126
|
+
bindata = data.pack("C*")
|
127
|
+
ret = @@device_wr.ioctl(IOCTL_SET_EACK_DATA,bindata)
|
128
|
+
ret = @@device_wr.ioctl(IOCTL_SET_EACK_ENB,1)
|
129
|
+
end
|
130
|
+
def getEnhanceAck()
|
131
|
+
data = Array.new(32,0)
|
132
|
+
bindata = data.pack("C*")
|
133
|
+
size = @@device_wr.ioctl(IOCTL_GET_EACK,bindata)
|
134
|
+
ret = bindata.unpack("C"+size.to_s)
|
135
|
+
end
|
136
|
+
def setAckTxInterval(interval)
|
137
|
+
size = @@device_wr.ioctl(IOCTL_SET_ACK_INTERVAL,interval)
|
138
|
+
end
|
118
139
|
def close()
|
119
140
|
data = 0
|
120
141
|
ret = @@device_wr.ioctl(IOCTL_SET_CLOSE,data)
|
data/lib/LazGem/version.rb
CHANGED
data/sample/sample_rx.rb
CHANGED
@@ -17,6 +17,10 @@ if ARGV.size == 0
|
|
17
17
|
printf("please input argument of ch at least\n")
|
18
18
|
printf("command format is shown below...\n")
|
19
19
|
printf("./sample_rx.rb ch panid baud pwr\n")
|
20
|
+
printf(" ch: 24-61\n")
|
21
|
+
printf(" panid: 0-0xffff\n")
|
22
|
+
printf(" baud: 50 or 100\n")
|
23
|
+
printf(" pwr: 1 or 20\n")
|
20
24
|
exit 0
|
21
25
|
end
|
22
26
|
|
@@ -56,6 +60,7 @@ print(sprintf("-----------------------------------------------------------------
|
|
56
60
|
# main routine
|
57
61
|
while finish_flag == 0 do
|
58
62
|
if laz.available() <= 0
|
63
|
+
sleep 0.01
|
59
64
|
next
|
60
65
|
end
|
61
66
|
rcv = laz.read()
|
data/sample/sample_tx.rb
CHANGED
@@ -17,13 +17,18 @@ if ARGV.size == 0
|
|
17
17
|
printf("please input argument of ch at least\n")
|
18
18
|
printf("command format is shown below...\n")
|
19
19
|
printf("./sample_tx.rb ch panid dst_short_addr baud pwr\n")
|
20
|
+
printf(" ch: 24-61\n")
|
21
|
+
printf(" panid: 0-0xffff\n")
|
22
|
+
printf(" dst..: distination address\n")
|
23
|
+
printf(" baud: 50 or 100\n")
|
24
|
+
printf(" pwr: 1 or 20\n")
|
20
25
|
exit 0
|
21
26
|
end
|
22
27
|
|
23
28
|
# open device deriver
|
24
29
|
laz.init()
|
25
30
|
|
26
|
-
dst_short_addr =
|
31
|
+
dst_short_addr = 0x444a
|
27
32
|
ch = 36
|
28
33
|
panid = 0xabcd
|
29
34
|
baud = 100
|
data/sample/sample_tx64.rb
CHANGED
@@ -17,6 +17,11 @@ if ARGV.size < 1
|
|
17
17
|
printf("please input argument of ch at least 1\n")
|
18
18
|
printf("command format is shown below...\n")
|
19
19
|
printf("./sample_tx.rb ch panid ieee_addr baud pwr\n")
|
20
|
+
printf(" ch: 24-61\n")
|
21
|
+
printf(" panid: 0-0xffff\n")
|
22
|
+
printf(" ieee..:0x001d....\n")
|
23
|
+
printf(" baud: 50 or 100\n")
|
24
|
+
printf(" pwr: 1 or 20\n")
|
20
25
|
exit 0
|
21
26
|
end
|
22
27
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: LazGem
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- NaotakaSaito
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-
|
12
|
+
date: 2017-08-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|