code: func SetPendingMACCommand(p *redis.Pool, devEUI lorawan.EUI64, block MACCommandBlock) error {
  	var buf bytes.Buffer
  	err := gob.NewEncoder(&buf).Encode(block)
  	if err != nil {
  		return errors.Wrap(err, "gob encode error")
  	}
  
  	c := p.Get()
  	defer c.Close()
  
  	key := fmt.Sprintf(macCommandPendingTempl, devEUI, block.CID)
  	exp := int64(deviceSessionTTL) / int64(time.Millisecond)
  
  	_, err = c.Do("PSETEX", key, exp, buf.Bytes())
  	if err != nil {
  		return errors.Wrap(err, "set mac-command pending error")
  	}
  
  	log.WithFields(log.Fields{
  		"dev_eui":  devEUI,
  		"cid":      block.CID,
  		"commands": len(block.MACCommands),
  	}).Info("pending mac-command block set")
  
  	return nil
  }
docs: // SetPendingMACCommand sets a mac-command to the pending buffer.
  // In case an other mac-command with the same CID has been set to pending,
  // it will be overwritten.