Coverage for aiocoap/numbers/types.py: 100%
10 statements
« prev ^ index » next coverage.py v7.6.8, created at 2024-11-28 12:34 +0000
« prev ^ index » next coverage.py v7.6.8, created at 2024-11-28 12:34 +0000
1# SPDX-FileCopyrightText: Christian Amsüss and the aiocoap contributors
2#
3# SPDX-License-Identifier: MIT
5"""List of known values for the CoAP "Type" field.
7As this field is only 2 bits, its valid values are comprehensively enumerated
8in the `Type` object.
9"""
11from enum import IntEnum
14class Type(IntEnum):
15 CON = 0 # Confirmable
16 NON = 1 # Non-confirmable
17 ACK = 2 # Acknowledgement
18 RST = 3 # Reset
20 def __str__(self):
21 return self.name
24CON, NON, ACK, RST = Type.CON, Type.NON, Type.ACK, Type.RST
26__all__ = ["Type", "CON", "NON", "ACK", "RST"]