iCoAP icon indicating copy to clipboard operation
iCoAP copied to clipboard

about observe

Open PlacidoLv opened this issue 7 years ago • 0 comments

- (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

PlacidoLv avatar Apr 02 '18 10:04 PlacidoLv