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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e0a2dbdff41f22ce85f74cde685dd75d6995077c
4
- data.tar.gz: d24cb261ced991ed7f76894c19bda074676ee96f
3
+ metadata.gz: f7a8d7dac05ffcb6c0bf725000a26eaf203f6359
4
+ data.tar.gz: 1b0ef77cc92e7f31995676a9f0d485ded976f998
5
5
  SHA512:
6
- metadata.gz: cf77d1003affcac84d8f759e695617a02e681d23887f07aef71cb748e39b8b406a9831a44d89f728ed75a24af4e9d58e2e1697519377f30e64fe90dff3f2f483
7
- data.tar.gz: 95b2f285d1a555187b5edf03474cd250a6c1dfbbe907ca9fcbdfec62196f45c11f4bd7244cdfff6620ee40ccd524c93c9797674257aec72d8a79f08246a09d7a
6
+ metadata.gz: 93c879be719de4f2fdfbda59ce9a740dd6c2153f1ab60d94473f5cc124d3ce14291dc979d1e47a245ed84f5fe7168be3a591c71393e05a102e097b3eb20a452a
7
+ data.tar.gz: 448b5ea510c8f318920fc97859108ddb969d5ee1bde3dd5a99ad3646d04511fc101a4f6bbe51a0f3d58a3fd5af00440e2496d368037bf56cba3c24a6f3315bd6
@@ -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)
@@ -1,3 +1,3 @@
1
1
  module LazGem
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -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()
@@ -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 = 0x6670
31
+ dst_short_addr = 0x444a
27
32
  ch = 36
28
33
  panid = 0xabcd
29
34
  baud = 100
@@ -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.0
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-05-12 00:00:00.000000000 Z
12
+ date: 2017-08-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler