Skip to content

Commit

Permalink
first release to support LazDriver
Browse files Browse the repository at this point in the history
  • Loading branch information
NaotakaSaito committed Sep 1, 2016
1 parent 625cd87 commit 4799fa6
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 41 deletions.
2 changes: 1 addition & 1 deletion lib/LazGem/device.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class LazGem::Device
@@device_wr=nil

def init()
cmd = "sudo insmod /home/pi/develop/LazDriver/lazdriver.ko"
cmd = "sudo insmod /home/pi/driver/LazDriver/lazdriver.ko"
p cmd
result = system(cmd)
lzgw_dev = "/dev/lzgw"
Expand Down
33 changes: 0 additions & 33 deletions sample/sample_ioctl.rb

This file was deleted.

4 changes: 2 additions & 2 deletions sample/sample_rx.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Function:
# Lazurite Sub-GHz/Lazurite Pi Gateway Sample program
# SerialMonitor.rb
require '../lib/LazGem'
require 'LazGem'

laz = LazGem::Device.new

Expand All @@ -23,7 +23,7 @@
# pwr: tx power 1 or 20
# mode: must be 2
laz.init()
laz.begin(33,0xABCD,100,20)
laz.begin(36,0xABCD,100,20)
print(sprintf("myAddress=0x%04x\n",laz.getMyAddress()))
laz.rxEnable()

Expand Down
8 changes: 4 additions & 4 deletions sample/sample_tx.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Function:
# Lazurite Sub-GHz/Lazurite Pi Gateway Sample program
# SerialMonitor.rb
require '../lib/LazGem'
require 'LazGem'

laz = LazGem::Device.new

Expand All @@ -28,7 +28,7 @@
# main routine
while finish_flag == 0 do
begin
laz.begin(33,0xABCD,100,20)
laz.begin(36,0xABCD,100,20)
rescue Exception => e
p "file io error!! reset driver"
laz.remove()
Expand All @@ -37,14 +37,14 @@
begin
payload =sprintf("hello pi gateway %d\n",i)
p payload
laz.send(0xabcd,0xac4e,payload)
laz.send(0xabcd,0x5fba,payload)
p laz.get_tx_rssi()
laz.close()
rescue Exception => e
p e
sleep 1
end
sleep 0.001
sleep 1.000
i = i + 1
end

Expand Down
2 changes: 1 addition & 1 deletion test/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Function:
# Lazurite Sub-GHz/Lazurite Pi Gateway Sample program
# SerialMonitor.rb
require_relative '../lib/LazGem'
require_relative 'LazGem'
require 'minitest'
require 'minitest/autorun'
require 'minitest/reporters'
Expand Down

0 comments on commit 4799fa6

Please sign in to comment.