HandleJoinRequest performs Join request to Join Server associated with req.JoinEUI.
( ctx context.Context, netID types.NetID, nsID *types.EUI64, req *ttnpb.JoinRequest, )
| 540 | |
| 541 | // HandleJoinRequest performs Join request to Join Server associated with req.JoinEUI. |
| 542 | func (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 | } |