@@ -34,43 +34,52 @@ void setup() {
3434
3535void loop () {
3636
37- // testing monitor
38- Monitor.println (String (i)+ " \t " +String (x ));
37+ // testing monitor
38+ Monitor.println (" \r\n " +String (i ));
3939 i++;
40- // working
40+
41+ // working
4142 Bridge.call (" 0_args_no_result" );
4243
4344 if (Bridge.call (" 0_args_no_result" )){
44- Monitor.println (" ok " ); // return true because no result
45+ Monitor.println (" 0_args_no_result TRUE without result " ); // return true because no result
4546 }
4647 else {
47- Monitor.println (" no " );
48+ Monitor.println (" 0_args_no_result FALSE without result " );
4849 }
4950
5051 if (Bridge.call (" 0_args_bool_result" )){
51- Monitor.println (" ok " );
52+ Monitor.println (" 0_args_bool_result TRUE without result " );
5253 }
5354 else {
54- Monitor.println (" no " ); // return false because you need check the result
55+ Monitor.println (" 0_args_bool_result FALSE without result " ); // return false because you need check the result
5556 }
5657
5758 x=false ;
5859 if (Bridge.call (" 0_args_bool_result" ).result (x)){
59- Monitor.println (" ok " +String (x)); // return true - the perfect call
60+ Monitor.println (" 0_args_bool_result TRUE with result: " +String (x)); // return true - the perfect call
61+ }
62+ else {
63+ Monitor.println (" 0_args_bool_result FALSE witt result: " +String (x));
64+ }
65+
66+ int y = -1 ;
67+ if (Bridge.call (" 0_args_bool_result" ).result (y)){
68+ Monitor.println (" 0_args_bool_result TRUE with result: " +String (y)+" (wrong result type)" ); // return true - the perfect call
6069 }
6170 else {
62- Monitor.println (" no " +String (x) );
71+ Monitor.println (" 0_args_bool_result FALSE with result: " +String (y)+ " (wrong result type) " );
6372 }
6473
6574
66- // avoid to do followings
75+ // avoid to do followings
6776
6877 RpcResult result = Bridge.call (" 0_args_bool_result" ); // the call happens but you won't get the result
6978
7079 bool x = false ;
7180 RpcResult result2 = Bridge.call (" 0_args_bool_result" );
7281 result2.result (x);
73- Monitor.println (" Result: " +String (x)); // return true, so the right result
82+ Monitor.println (" Result of assignment and then result : " +String (x)); // return true, so the right result
7483
7584 delay (1000 );
7685}
0 commit comments