code: func (n *NetworkServerAPI) UpdateDevice(ctx context.Context, req *ns.UpdateDeviceRequest) (*empty.Empty, error) {
  	if req.Device == nil {
  		return nil, grpc.Errorf(codes.InvalidArgument, "device must not be nil")
  	}
  
  	var devEUI lorawan.EUI64
  	var dpID, spID, rpID uuid.UUID
  
  	copy(devEUI[:], req.Device.DevEui)
  	copy(dpID[:], req.Device.DeviceProfileId)
  	copy(rpID[:], req.Device.RoutingProfileId)
  	copy(spID[:], req.Device.ServiceProfileId)
  
  	d, err := storage.GetDevice(storage.DB(), devEUI)
  	if err != nil {
  		return nil, errToRPCError(err)
  	}
  
  	d.DeviceProfileID = dpID
  	d.ServiceProfileID = spID
  	d.RoutingProfileID = rpID
  	d.SkipFCntCheck = req.Device.SkipFCntCheck
  	d.ReferenceAltitude = req.Device.ReferenceAltitude
  
  	if err := storage.UpdateDevice(storage.DB(), &d); err != nil {
  		return nil, errToRPCError(err)
  	}
  
  	return &empty.Empty{}, nil
  }
docs: // UpdateDevice updates the given device.