Coverage for aiocoap/numbers/types.py: 100%

Shortcuts on this page

r m x   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

9 statements  

1# This file is part of the Python aiocoap library project. 

2# 

3# Copyright (c) 2012-2014 Maciej Wasilak <http://sixpinetrees.blogspot.com/>, 

4# 2013-2014 Christian Amsüss <c.amsuess@energyharvesting.at> 

5# 

6# aiocoap is free software, this file is published under the MIT license as 

7# described in the accompanying LICENSE file. 

8 

9"""List of known values for the CoAP "Type" field. 

10 

11As this field is only 2 bits, its valid values are comprehensively enumerated 

12in the `Type` object. 

13""" 

14 

15from enum import IntEnum 

16 

17class Type(IntEnum): 

18 CON = 0 # Confirmable 

19 NON = 1 # Non-confirmable 

20 ACK = 2 # Acknowledgement 

21 RST = 3 # Reset 

22 

23CON, NON, ACK, RST = Type.CON, Type.NON, Type.ACK, Type.RST 

24 

25__all__ = ['Type', 'CON', 'NON', 'ACK', 'RST']