def _action_TXCON(self):

        # log
        log.debug('_action_TXCON()')

        # flag error if max number of CON transmits reached
        if self.numTxCON>self.maxRetransmit+1:
            # this is an error case
            self.coapError   = e.coapTimeout('No ACK received after {0} tries (max {1})'.format(
                    self.numTxCON,
                    self.maxRetransmit+1,
                )
            )
            return

        # build message
        message = m.buildMessage(
            msgtype             = d.TYPE_CON,
            token            = self.token,
            code             = self.code,
            messageId        = self.messageId,
            options          = self.options,
            payload          = self.payload,
        )

        # send
        self.sendFunc(
            destIp           = self.destIp,
            destPort         = self.destPort,
            msg              = message,
        )

        # increment number of transmitted messages
        self.numTxCON       += 1

        # update FSM state
        self._setState(self.STATE_WAITFORACK)

        # kick FSM
        self._kickFsm()
dataset/ETHPy150Open openwsn-berkeley/coap/coap/coapTransmitter.py/coapTransmitter._action_TXCON/original