-
-
Save stephenlb/01016ecc1ddb3d29e9384b1918ee6984 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public void cleanup(){ | |
| try { | |
| JSONObject payload = new JSONObject(); | |
| JSONObject left = new JSONObject(); | |
| JSONObject right = new JSONObject(); | |
| left.put("left_yaw", 400); | |
| left.put("left_pitch",400); | |
| right.put("right_yaw", 400); | |
| right.put("right_pitch",400); | |
| payload.put("left_hand", left); | |
| payload.put("right_hand", right); | |
| pubnub.publish() | |
| .message(payload) | |
| .channel(CHANNEL) | |
| .async(new PNCallback<PNPublishResult>() { | |
| @Override | |
| public void onResponse(PNPublishResult result, PNStatus status) { | |
| // handle publish result, status always present, result if successful | |
| // status.isError to see if error happened | |
| } | |
| }); | |
| } catch (JSONException e){ | |
| e.printStackTrace(); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment