Skip to content

Commit 693385e

Browse files
committed
gpio/sockets test support
1 parent 47f502c commit 693385e

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

coder-apps/tests/socket_test/static/js/index.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,24 @@ $(document).ready( function() {
33

44
//This code will run after your page loads
55
Coder.socketConnection.init(function(){
6-
console.log("connected with ID: " + Coder.socketConnection.socketID);
76

8-
Coder.socketConnection.sendData( 'connect', {'name':'jimmy'} );
7+
addOutputMessage( "Connected with ID: " + Coder.socketConnection.socketID );
8+
9+
10+
Coder.socketConnection.sendData( 'connect', {'name':'testing'} );
911

1012
Coder.socketConnection.addListener( 'message', function( d ){
1113
console.log("message from: " + d.name + " : " + d.message);
1214
});
1315
});
1416

17+
addOutputMessage( "Connecting... see the debug console for log messages." );
18+
1519
});
1620

21+
var addOutputMessage = function( text ) {
22+
var $output = $("#output");
23+
$output.prepend( $("<p/>").text( text ) );
24+
console.log( text );
25+
}
26+

coder-apps/tests/socket_test/views/index.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,10 @@
2525
</head>
2626
<body class="">
2727
<div class="pagecontent">
28-
<h1>Hello World</h1>
29-
<p>Your html goes here.</p>
30-
28+
<h1>Socket Test</h1>
29+
<div id="output">
30+
31+
</div>
3132
</div>
3233
</body>
3334
</html>

raspbian-addons/home/coder/coder-dist/coder-base/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@
1313
"bcrypt": "0.7.4",
1414
"connect": "*",
1515
"cookie": "*",
16-
"gpio": "*",
16+
"gpio": "*"
1717
}
1818
}

0 commit comments

Comments
 (0)