Jump to main content

##

# 2.77.2 OTPC_WritePacket Function

## C

    otpc_error_code_t OTPC_WritePacket(const OTPC_NEW_PACKET *packet,
    const uint32_t *payload,
    uint16_t *headerAddress,
    uint16_t *sizeWritten);

## Summary

Perform an OTPC packet write.

## Description

Create a new packet with the given payload. Returns the address of the packet and size written (in number of bytes).

## Precondition

OTPC_Initialize() function must have been called first.

## Parameters

Param | Description
--- | ---
packet | Pointer to the structure defining the packet attributes
payload | Pointer to the address of new payload
headerAddress | Address of the newly created packet(output)}
sizeWritten | number of bytes written into the new packet

## Returns

otpc error code.

## Example

    OTPC_Initialize();
    OTPC_WritePacket(&packet, &payload, &headerAddress, &sizeWritten);

## Remarks

None