Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Tweak choreography

  • Loading branch information...
commit 34d95025c8258c0968dbc63fd2d43b6ea3639e5b 1 parent c441ae7
@quimarche authored
View
BIN  files/cancelled.nab
Binary file not shown
View
BIN  files/failure.nab
Binary file not shown
View
BIN  files/hanging.nab
Binary file not shown
View
BIN  files/success.nab
Binary file not shown
View
9 trudy.rb
@@ -55,6 +55,11 @@ def trudy_packet_ambient_block frequency
[0x04, 0x00, 0x00, 0x17 + frequency, 0x7F, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] + [0x01] * frequency + [0x00]
end
+ def trudy_packet_choreography status
+ ears = {'cancelled' => 0x05, 'failure' => 0x0A, 'hanging' => 0x0F, 'success' => 0x00}[status]
+ [0x00, 0x00, 0x00, 0x0A] + [0x00, 0x08, 0x00, ears, 0x00] + [0x00, 0x08, 0x01, ears, 0x00] + [0x00, 0x00, 0x00, 0x00]
+ end
+
def trudy_packet_foot
[0xFF]
end
@@ -117,6 +122,10 @@ def trudy_packet_reboot_block
sass :index
end
+ get '/:filename.nab' do
+ send_packet trudy_packet_choreography params[:filename]
+ end
+
get '/:filename' do
send_file trudy_file params[:filename]
end
Please sign in to comment.
Something went wrong with that request. Please try again.