MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / HandleJoinRequest

Method HandleJoinRequest

pkg/interop/client.go:542–556  ·  view source on GitHub ↗

HandleJoinRequest performs Join request to Join Server associated with req.JoinEUI.

(
	ctx context.Context, netID types.NetID, nsID *types.EUI64, req *ttnpb.JoinRequest,
)

Source from the content-addressed store, hash-verified

540
541// HandleJoinRequest performs Join request to Join Server associated with req.JoinEUI.
542func (cl Client) HandleJoinRequest(
543 ctx context.Context, netID types.NetID, nsID *types.EUI64, req *ttnpb.JoinRequest,
544) (*ttnpb.JoinResponse, error) {
545 pld := req.Payload.GetJoinRequestPayload()
546 if pld == nil {
547 return nil, errNoJoinRequestPayload.New()
548 }
549 jss := cl.matchingJoinServerClients(types.MustEUI64(pld.JoinEui).OrZero())
550 if len(jss) == 0 {
551 return nil, errNotRegistered.New()
552 }
553 return joinServerRace(ctx, func(js joinServerClient) (*ttnpb.JoinResponse, error) {
554 return js.HandleJoinRequest(ctx, netID, nsID, req)
555 }, jss)
556}

Callers 2

TestHandleJoinRequestFunction · 0.95
TestJoinServerRaceFunction · 0.95

Calls 7

MustEUI64Function · 0.92
joinServerRaceFunction · 0.85
GetJoinRequestPayloadMethod · 0.80
NewMethod · 0.65
HandleJoinRequestMethod · 0.65
OrZeroMethod · 0.45

Tested by 2

TestHandleJoinRequestFunction · 0.76
TestJoinServerRaceFunction · 0.76