Skip to content

Commit

Permalink
ability to set sxl version
Browse files Browse the repository at this point in the history
  • Loading branch information
emiltin committed Dec 4, 2019
1 parent c9eaa1e commit a16ef63
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 4 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,12 @@

## 0.1.0
Initial release.

## 0.1.1
Refactoring.

## 0.1.2
Refactoring.

## 0.1.3
Refactoring.
4 changes: 2 additions & 2 deletions lib/rsmp/proxy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def check_ack_timeout now
@awaiting_acknowledgement.clone.each_pair do |m_id, message|
latest = message.timestamp + timeout
if now > latest
log "No acknowledgements for #{message.type} within #{timeout} seconds", level: :error
log "No acknowledgements for #{message.type} #{message.m_id_short} within #{timeout} seconds", level: :error
stop
return true
end
Expand Down Expand Up @@ -359,7 +359,7 @@ def send_version rsmp_versions
version_response = Version.new({
"RSMP"=>versions_hash,
"siteId"=>[{"sId"=>@settings["site_id"]}],
"SXL"=>"1.1"
"SXL"=>@settings["sxl_version"]
})
send_message version_response
end
Expand Down
1 change: 1 addition & 0 deletions lib/rsmp/site.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def handle_site_settings options
{ 'ip' => '127.0.0.1', 'port' => 12111 }
],
'rsmp_versions' => ['3.1.1','3.1.2','3.1.3','3.1.4'],
'sxl_version' => '1.0.7',
'timer_interval' => 0.1,
'watchdog_interval' => 1,
'watchdog_timeout' => 2,
Expand Down
1 change: 1 addition & 0 deletions lib/rsmp/supervisor.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def handle_supervisor_settings options
'site_id' => 'RN+SU0001',
'port' => 12111,
'rsmp_versions' => ['3.1.1','3.1.2','3.1.3','3.1.4'],
'sxl_version' => '1.0.7',
'timer_interval' => 0.1,
'watchdog_interval' => 1,
'watchdog_timeout' => 2,
Expand Down
4 changes: 2 additions & 2 deletions spec/supervisor_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
protocol = Async::IO::Protocol::Line.new(stream,RSMP::WRAPPING_DELIMITER) # rsmp messages are json terminated with a form-feed

# write version message
protocol.write_lines '{"mType":"rSMsg","type":"Version","RSMP":[{"vers":"3.1.4"}],"siteId":[{"sId":"RN+SI0001"}],"SXL":"1.1","mId":"8db00f0a-4124-406f-b3f9-ceb0dbe4aeb6"}'
protocol.write_lines '{"mType":"rSMsg","type":"Version","RSMP":[{"vers":"3.1.4"}],"siteId":[{"sId":"RN+SI0001"}],"SXL":"1.0.7","mId":"8db00f0a-4124-406f-b3f9-ceb0dbe4aeb6"}'
# supervisor should see our tcp socket and create a proxy
proxy = supervisor.wait_for_site "RN+SI0001", 0.1
expect(proxy).to be_an(RSMP::SiteProxy)
Expand All @@ -66,7 +66,7 @@


version = JSON.parse protocol.read_line
expect(version).to eq({"RSMP"=>[{"vers"=>"3.1.4"}], "SXL"=>"1.1", "mId"=>"1b206e56-31be-4739-9164-3a24d47b0aa2", "mType"=>"rSMsg", "siteId"=>[{"sId"=>"RN+SU0001"}], "type"=>"Version"})
expect(version).to eq({"RSMP"=>[{"vers"=>"3.1.4"}], "SXL"=>"1.0.7", "mId"=>"1b206e56-31be-4739-9164-3a24d47b0aa2", "mType"=>"rSMsg", "siteId"=>[{"sId"=>"RN+SU0001"}], "type"=>"Version"})

protocol.write_lines JSON.generate("mType"=>"rSMsg","type"=>"MessageAck","oMId"=>version["mId"],"mId"=>SecureRandom.uuid())
expect {
Expand Down

0 comments on commit a16ef63

Please sign in to comment.