This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

I have create a custom generic message class in iOS, to pass some data value to nordic device, in generic onoff server. Here i face problem that when i try to send the message to nordic device, it sends again again the message.

 when i use that message to  pass some data value to nordic device,  in generic onoff server. i face problem that when i try to send the message to nordic device, it sends again again the message. In console log appear as resending the message in access layer. After 3 to 4 try it get canceled with a error message. I use docklight to check receive message in nordic device  and it verify that it receive the message. i am using the nrf5 sdk 540 device to test.

message parameter contain [int8] array

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import Foundation
public struct GenericConfigSet: GenericMessage, TransactionMessage, TransitionMessage {
public static let opCode: UInt32 = 0x8206
// public static let responseType: StaticMeshMessage.Type = GenericLevelStatus.self
public var tid: UInt8!
public var parameters: Data? {
let data = Data() + byteArray + tid
if let transitionTime = transitionTime, let delay = delay {
return data + transitionTime.rawValue + delay
} else {
return data
}
}
/// The target value of the Generic Level state.
public let byteArray: [UInt8]
public let transitionTime: TransitionTime?
public let delay: UInt8?
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • Hi Summit, 

    Could you show the code where you sent the message ? 
    Note that if you sent the message as a reliable message (requires acknowledge) the phone expect to get the reply packet from the mesh node. In your mesh code do you have that reply implemented ? 
    Do you see the same problem when testing with the stock generic on off server ? 

  • no sir i am not implement any reply code ? can you plz tell me how to implement, and where to implement that.

  • You can have a look at the Generic ON OFF model. In function handle_set() you can find that status_send() is called when handling the set command. This is to reply (ACK) to a set command . Inside status_send() you can find access_model_reply() is called. 

  • But Sir, i don't find any Generic on off model, in library there are only generic on off -  get, set, status.

    And there a file GenericOnOffServerDelegate. do you mean that?.  (i m asking for swift library)

  • Hi, 
    When I say replying packet, it's the reply from the mesh node. Not from the phone. 

    When the phone sending generic onoff set, it expecting to have a reply from the node (nRF52)

    Please make sure that was implemented on the node as I mentioned in last reply.

1 2