AJA NTV2 SDK  17.0.1.1246
NTV2 SDK 17.0.1.1246
devicenotifier.cpp File Reference

Implements the MacOS-specific KonaNotifier and DeviceNotifier classes, which invoke a client-registered callback function when devices are attached and/or detached. More...

#include <syslog.h>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <IOKit/IOCFPlugIn.h>
#include "ajantv2/includes/ajatypes.h"
#include "devicenotifier.h"
#include "ajabase/common/common.h"
#include "ajabase/system/debug.h"
Include dependency graph for devicenotifier.cpp:

Go to the source code of this file.

Macros

#define HEX2(__x__)   "0x" << hex << setw(2) << setfill('0') << (0x00FF & uint16_t(__x__)) << dec
 
#define HEX4(__x__)   "0x" << hex << setw(4) << setfill('0') << (0xFFFF & uint16_t(__x__)) << dec
 
#define HEX8(__x__)   "0x" << hex << setw(8) << setfill('0') << (0xFFFFFFFF & uint32_t(__x__)) << dec
 
#define HEX16(__x__)   "0x" << hex << setw(16) << setfill('0') << uint64_t(__x__) << dec
 
#define KR(_kr_)   "kernErr=" << HEX8(_kr_) << "(" << ::GetKernErrStr(_kr_) << ")"
 
#define INST(__p__)   "Ins-" << hex << setw(16) << setfill('0') << uint64_t(__p__) << dec
 
#define THRD(__t__)   "Thr-" << hex << setw(16) << setfill('0') << uint64_t(__t__) << dec
 
#define DNDB(__lvl__, __x__)   AJA_sREPORT(AJA_DebugUnit_PnP, (__lvl__), INST(this) << ": " << AJAFUNC << ": " << __x__)
 
#define DNFAIL(__x__)   DNDB(AJA_DebugSeverity_Error, __x__)
 
#define DNWARN(__x__)   DNDB(AJA_DebugSeverity_Warning, __x__)
 
#define DNNOTE(__x__)   DNDB(AJA_DebugSeverity_Notice, __x__)
 
#define DNINFO(__x__)   DNDB(AJA_DebugSeverity_Info, __x__)
 
#define DNDBG(__x__)   DNDB(AJA_DebugSeverity_Debug, __x__)
 

Functions

static const char * GetKernErrStr (const kern_return_t inError)
 

Detailed Description

Implements the MacOS-specific KonaNotifier and DeviceNotifier classes, which invoke a client-registered callback function when devices are attached and/or detached.

Definition in file devicenotifier.cpp.

Macro Definition Documentation

◆ DNDB

#define DNDB (   __lvl__,
  __x__ 
)    AJA_sREPORT(AJA_DebugUnit_PnP, (__lvl__), INST(this) << ": " << AJAFUNC << ": " << __x__)

Definition at line 35 of file devicenotifier.cpp.

◆ DNDBG

#define DNDBG (   __x__)    DNDB(AJA_DebugSeverity_Debug, __x__)

Definition at line 40 of file devicenotifier.cpp.

◆ DNFAIL

#define DNFAIL (   __x__)    DNDB(AJA_DebugSeverity_Error, __x__)

Definition at line 36 of file devicenotifier.cpp.

◆ DNINFO

#define DNINFO (   __x__)    DNDB(AJA_DebugSeverity_Info, __x__)

Definition at line 39 of file devicenotifier.cpp.

◆ DNNOTE

#define DNNOTE (   __x__)    DNDB(AJA_DebugSeverity_Notice, __x__)

Definition at line 38 of file devicenotifier.cpp.

◆ DNWARN

#define DNWARN (   __x__)    DNDB(AJA_DebugSeverity_Warning, __x__)

Definition at line 37 of file devicenotifier.cpp.

◆ HEX16

#define HEX16 (   __x__)    "0x" << hex << setw(16) << setfill('0') << uint64_t(__x__) << dec

Definition at line 30 of file devicenotifier.cpp.

◆ HEX2

#define HEX2 (   __x__)    "0x" << hex << setw(2) << setfill('0') << (0x00FF & uint16_t(__x__)) << dec

Definition at line 27 of file devicenotifier.cpp.

◆ HEX4

#define HEX4 (   __x__)    "0x" << hex << setw(4) << setfill('0') << (0xFFFF & uint16_t(__x__)) << dec

Definition at line 28 of file devicenotifier.cpp.

◆ HEX8

#define HEX8 (   __x__)    "0x" << hex << setw(8) << setfill('0') << (0xFFFFFFFF & uint32_t(__x__)) << dec

Definition at line 29 of file devicenotifier.cpp.

◆ INST

#define INST (   __p__)    "Ins-" << hex << setw(16) << setfill('0') << uint64_t(__p__) << dec

Definition at line 32 of file devicenotifier.cpp.

◆ KR

#define KR (   _kr_)    "kernErr=" << HEX8(_kr_) << "(" << ::GetKernErrStr(_kr_) << ")"

Definition at line 31 of file devicenotifier.cpp.

◆ THRD

#define THRD (   __t__)    "Thr-" << hex << setw(16) << setfill('0') << uint64_t(__t__) << dec

Definition at line 33 of file devicenotifier.cpp.

Function Documentation

◆ GetKernErrStr()

static const char * GetKernErrStr ( const kern_return_t  inError)
static

Definition at line 428 of file devicenotifier.cpp.