1
0
Fork 0

initial build framework for CITP

This commit is contained in:
Kevin Matz 2023-03-31 11:22:01 -04:00
parent e1c1c1b579
commit 7b436915d8
5 changed files with 73 additions and 1 deletions

View File

@ -104,7 +104,8 @@ FILE_VERSION_FILTER =
LAYOUT_FILE =
CITE_BIB_FILES = @CMAKE_CURRENT_SOURCE_DIR@/protocol/artistic/ARTISTIC.bib \
@CMAKE_CURRENT_SOURCE_DIR@/protocol/esta/ESTA.bib \
@CMAKE_CURRENT_SOURCE_DIR@/protocol/ietf/IETF.bib
@CMAKE_CURRENT_SOURCE_DIR@/protocol/ietf/IETF.bib \
@CMAKE_CURRENT_SOURCE_DIR@/protocol/citp/CITP.bib
#---------------------------------------------------------------------------
# Configuration options related to warning and progress messages
#---------------------------------------------------------------------------

View File

@ -24,3 +24,6 @@ add_subdirectory(artistic)
# OpenSoundControl
add_subdirectory(osc)
# Controller Interface Transport Protocol
add_subdirectory(citp)

5
protocol/citp/CITP.bib Normal file
View File

@ -0,0 +1,5 @@
@manual{CITP,
key = "CITP",
title = "CITP protocol suite specification",
year = 2020,
}

View File

@ -0,0 +1,13 @@
project(${PROJECT_NAME}-citp VERSION 0.3.1 LANGUAGES CXX)
add_library(${PROJECT_NAME} SHARED)
add_library(LCP::CITP ALIAS ${PROJECT_NAME})
target_sources(${PROJECT_NAME}
PUBLIC
citp.h
)
set_target_properties(${PROJECT_NAME} PROPERTIES LINKER_LANGUAGE CXX)
set_target_properties(${PROJECT_NAME} PROPERTIES VERSION ${PROJECT_VERSION})
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})

50
protocol/citp/citp.h Normal file
View File

@ -0,0 +1,50 @@
/*
citp.h
Copyright (c) 2023 Kevin Matz (kevin.matz@gmail.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#pragma once
#include <cstdint>
namespace CITP {
/**
* @brief \cite CITP 3.1.1 The CITP header
*
* The CITP layer provides a standard, single, header used at the start of all CITP packets.
*/
struct CITP_Header
{
uint32_t Cookie; ///< Set to "CITP".
uint8_t VersionMajor; ///< Set to 1.
uint8_t VersionMinor; ///< Set to 0.
union {
uint16_t RequestIndex;
uint16_t InResponseTo;
};
uint32_t MessageSize; ///< The size of the entire message, including this header.
uint16_t MessagePartCount; ///< Number of message fragments.
uint16_t MessagePart; ///< Index of this message fragment (0-based).
uint32_t ContentType; ///< Cookie identifying the type of the second layer.
};
} // namespace CITP