iCoAP
iCoAP copied to clipboard
about observe
- (IBAction)onTapSend:(id)sender {
[self.textField resignFirstResponder];
ICoAPMessage *cO = [[ICoAPMessage alloc] initAsRequestConfirmable:YES requestMethod:IC_GET sendToken:YES payload:@""];
[cO addOption:IC_URI_PATH withValue:@"obs-non"];
[cO addOption:IC_OBSERVE withValue:@"0"];
if (!iExchange) {
iExchange = [[ICoAPExchange alloc] initAndSendRequestWithCoAPMessage:cO toHost:@"wsncoap.org" port:5683 delegate:self];
}
else {
[iExchange sendRequestWithCoAPMessage:cO toHost:@"wsncoap.org" port:5683];
}
self.activityIndicator.hidden = NO;
}
This is my method of adding observe. Why can I only receive one reply? What should I set up? Thanks for help