/** * Digital Voice Modem - Host Software * GPLv2 Open Source. Use is subject to license terms. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * @package DVM / Host Software * */ // // Based on code from the MMDVMHost project. (https://github.com/g4klx/MMDVMHost) // Licensed under the GPLv2 License (https://opensource.org/licenses/GPL-2.0) // /* * Copyright (C) 2016 by Jonathan Naylor G4KLX * Copyright (C) 2017-2019 by Bryan Biedenkapp N2PLL * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #if !defined(__P25_LC__TSBK_H__) #define __P25_LC__TSBK_H__ #include "Defines.h" #include "p25/edac/Trellis.h" #include "p25/lc/LC.h" #include "p25/lc/TDULC.h" #include "p25/SiteData.h" #include "edac/RS634717.h" #include "lookups/IdenTableLookup.h" #include namespace p25 { namespace lc { // --------------------------------------------------------------------------- // Class Prototypes // --------------------------------------------------------------------------- class HOST_SW_API LC; class HOST_SW_API TDULC; // --------------------------------------------------------------------------- // Class Declaration // Represents link control data for TSDU packets. // --------------------------------------------------------------------------- class HOST_SW_API TSBK { public: /// Initializes a new instance of the TSBK class. TSBK(); /// Finalizes a instance of the TSBK class. ~TSBK(); /// Decode a trunking signalling block. bool decode(const uint8_t* data); /// Encode a trunking signalling block. void encode(uint8_t* data, bool singleBlock); /// Helper to reset data values to defaults. void reset(); /// void setVendorSkip(bool skip); /** Local Site data */ /// Sets local configured site data. void setSiteData(SiteData siteData); /// Sets local configured site callsign. void setCallsign(std::string callsign); /// void setIdenTable(lookups::IdenTable entry); /// Sets a flag indicating whether or not networking is active. void setNetActive(bool netActive); /// Sets the total number of channels at the site. void setSiteChCnt(uint8_t chCnt); public: /** Common Data */ /// Flag indicating the link control data is protected. __PROPERTY(bool, protect, Protect); /// Link control opcode. __PROPERTY(uint8_t, lco, LCO); /// Manufacturer ID. __PROPERTY(uint8_t, mfId, MFId); /// Source ID. __PROPERTY(uint32_t, srcId, SrcId); /// Destination ID. __PROPERTY(uint32_t, dstId, DstId); /// Flag indicating this is the last TSBK in a sequence of TSBKs. __PROPERTY(bool, lastBlock, LastBlock); /// Flag indicating this TSBK contains additional information. __PROPERTY(bool, aivFlag, AIV); /// Service type. __PROPERTY(uint8_t, service, Service); /// Response type. __PROPERTY(uint8_t, response, Response); /// Configured network ID. __READONLY_PROPERTY(uint32_t, netId, NetId); /// Configured system ID. __READONLY_PROPERTY(uint32_t, sysId, SysId); /// Voice channel number. __PROPERTY(uint32_t, grpVchNo, GrpVchNo); /// Message value. __PROPERTY(uint32_t, messageValue, Message); /// Status value. __PROPERTY(uint8_t, statusValue, Status); /// Extended function opcode. __PROPERTY(uint32_t, extendedFunction, ExtendedFunction); /** Adjacent Site Data */ /// Adjacent site CFVA flags. __PROPERTY(uint8_t, adjCFVA, AdjSiteCFVA); /// Adjacent site system ID. __PROPERTY(uint32_t, adjSysId, AdjSiteSysId); /// Adjacent site RFSS ID. __PROPERTY(uint8_t, adjRfssId, AdjSiteRFSSId); /// Adjacent site ID. __PROPERTY(uint8_t, adjSiteId, AdjSiteId); /// Adjacent site channel ID. __PROPERTY(uint8_t, adjChannelId, AdjSiteChnId); /// Adjacent site channel number. __PROPERTY(uint32_t, adjChannelNo, AdjSiteChnNo); /** Patch Group data */ /// Patch super group ID. __PROPERTY(uint32_t, patchSuperGroupId, PatchSuperGroupId); /// 1st patch group ID. __PROPERTY(uint32_t, patchGroup1Id, PatchGroup1Id); /// 2nd patch group ID. __PROPERTY(uint32_t, patchGroup2Id, PatchGroup2Id); /// 3rd patch group ID. __PROPERTY(uint32_t, patchGroup3Id, PatchGroup3Id); /** Service Options */ /// Flag indicating the emergency bits are set. __PROPERTY(bool, emergency, Emergency); /// Flag indicating that encryption is enabled. __PROPERTY(bool, encrypted, Encrypted); /// Priority level for the traffic. __PROPERTY(uint8_t, priority, Priority); /// Flag indicating a group/talkgroup operation. __PROPERTY(bool, group, Group); private: friend class LC; friend class TDULC; edac::RS634717 m_rs; edac::Trellis m_trellis; bool m_vendorSkip; bool m_sndcpAutoAccess; bool m_sndcpReqAccess; uint16_t m_sndcpDAC; /** Local Site data */ SiteData m_siteData; uint8_t* m_siteCallsign; lookups::IdenTable m_siteIdenEntry; bool m_siteNetActive; uint8_t m_siteChCnt; }; } // namespace lc } // namespace p25 #endif // __P25_LC__TSBK_H__