TwiceAsNice  2019-02-18
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
Nsmsg Class Reference

#include <nsmsg.h>

Collaboration diagram for Nsmsg:
Collaboration graph

Public Member Functions

 Nsmsg ()
 
 Nsmsg (NsChannel *channel)
 
int sendtemp (float temp, bool cooler_on)
 
int senddur (float expo, int framediv, bool dark)
 
int sendzone (int start_y, int lines, int framediv)
 
int sendfan (int speed)
 
int rcvstat (void)
 
float rcvtemp (void)
 
int getRawImgSize ()
 
int getRawImgSize (int start_y, int lines, int framediv)
 
bool inquiry (void)
 
int abort (void)
 
int getResp4 ()
 
const char * getFirmwareVer ()
 

Private Member Functions

void calczone (int start_y_offset, int num_lines, int framediv)
 
void settemp (float temp, bool cooler_on)
 
void setdur (float expo, int framediv, bool dark)
 
void setzone (int start_y, int lines, int framediv)
 
void setfan (int speed)
 
float gettemp (void)
 
int sendcmd (const char *name)
 
void hexdump (const char *pre, const void *data, int size)
 

Private Attributes

short start_y
 
short lines
 
int imgsz
 
float temp_set
 
float temp_act
 
int curr_status
 
int resp_4
 
char firmware_ver [25]
 
unsigned char cmd [CMD_SIZE]
 
unsigned char resp [CMD_SIZE+1]
 
NsChannelchan
 
std::mutex cmdmutex
 

Static Private Attributes

static const unsigned char inq [CMD_SIZE] = {0xa5, 0x1, 0,0,0,0,0,0,0,0,0,0,0,0,0,0}
 
static const unsigned char sts [CMD_SIZE] = {0xa5, 0x2, 0,0,0,0,0,0,0,0,0,0,0,0,0,0}
 
static const unsigned char abt [CMD_SIZE] = {0xa5, 0x4, 0,0,0,0,0,0,0,0,0,0,0,0,0,0}
 
static const unsigned char stp [CMD_SIZE] = {0xa5, 0x8, 0,0,0,0,0,0,0,0,0,0,0,0,0,0}
 
static const unsigned char gtp [CMD_SIZE] = {0xa5, 0x9, 0,0,0,0,0,0,0,0,0,0,0,0,0,0}
 
static const unsigned char fan [CMD_SIZE] = {0xa5, 0xa, 0,0,0,0,0,0,0,0,0,0,0,0,0,0}
 
static const unsigned char inqr_8600 [CMD_SIZE] = {0xA5,1,1,0x80,0,0x4F,0xD8,1,0x26,0,0,0,0,0,0,0}
 
static const unsigned char dur [CMD_SIZE] = {0xa5, 0x3, 0,0,0,0,0xb,0,0,0,0,0,0,0,0,0}
 
static const unsigned char zon [CMD_SIZE] = {0xa5, 0x7, 0,0,0,0, 0,0,0,0, 0x1a,0x82,0,0,7,0}
 

Constructor & Destructor Documentation

◆ Nsmsg() [1/2]

Nsmsg::Nsmsg ( )

◆ Nsmsg() [2/2]

Nsmsg::Nsmsg ( NsChannel channel)
inline

Member Function Documentation

◆ abort()

int Nsmsg::abort ( void  )

◆ calczone()

void Nsmsg::calczone ( int  start_y_offset,
int  num_lines,
int  framediv 
)
private

◆ getFirmwareVer()

const char * Nsmsg::getFirmwareVer ( )

◆ getRawImgSize() [1/2]

int Nsmsg::getRawImgSize ( )

◆ getRawImgSize() [2/2]

int Nsmsg::getRawImgSize ( int  start_y,
int  lines,
int  framediv 
)

◆ getResp4()

int Nsmsg::getResp4 ( )

◆ gettemp()

float Nsmsg::gettemp ( void  )
private

◆ hexdump()

void Nsmsg::hexdump ( const char *  pre,
const void *  data,
int  size 
)
private

◆ inquiry()

bool Nsmsg::inquiry ( void  )

◆ rcvstat()

int Nsmsg::rcvstat ( void  )

◆ rcvtemp()

float Nsmsg::rcvtemp ( void  )

◆ sendcmd()

int Nsmsg::sendcmd ( const char *  name)
private

◆ senddur()

int Nsmsg::senddur ( float  expo,
int  framediv,
bool  dark 
)

◆ sendfan()

int Nsmsg::sendfan ( int  speed)

◆ sendtemp()

int Nsmsg::sendtemp ( float  temp,
bool  cooler_on 
)

◆ sendzone()

int Nsmsg::sendzone ( int  start_y,
int  lines,
int  framediv 
)

◆ setdur()

void Nsmsg::setdur ( float  expo,
int  framediv,
bool  dark 
)
private

◆ setfan()

void Nsmsg::setfan ( int  speed)
private

◆ settemp()

void Nsmsg::settemp ( float  temp,
bool  cooler_on 
)
private

◆ setzone()

void Nsmsg::setzone ( int  start_y,
int  lines,
int  framediv 
)
private

Member Data Documentation

◆ abt

const unsigned char Nsmsg::abt = {0xa5, 0x4, 0,0,0,0,0,0,0,0,0,0,0,0,0,0}
staticprivate

◆ chan

NsChannel* Nsmsg::chan
private

◆ cmd

unsigned char Nsmsg::cmd[CMD_SIZE]
private

◆ cmdmutex

std::mutex Nsmsg::cmdmutex
private

◆ curr_status

int Nsmsg::curr_status
private

◆ dur

const unsigned char Nsmsg::dur = {0xa5, 0x3, 0,0,0,0,0xb,0,0,0,0,0,0,0,0,0}
staticprivate

◆ fan

const unsigned char Nsmsg::fan = {0xa5, 0xa, 0,0,0,0,0,0,0,0,0,0,0,0,0,0}
staticprivate

◆ firmware_ver

char Nsmsg::firmware_ver[25]
private

◆ gtp

const unsigned char Nsmsg::gtp = {0xa5, 0x9, 0,0,0,0,0,0,0,0,0,0,0,0,0,0}
staticprivate

◆ imgsz

int Nsmsg::imgsz
private

◆ inq

const unsigned char Nsmsg::inq = {0xa5, 0x1, 0,0,0,0,0,0,0,0,0,0,0,0,0,0}
staticprivate

◆ inqr_8600

const unsigned char Nsmsg::inqr_8600 = {0xA5,1,1,0x80,0,0x4F,0xD8,1,0x26,0,0,0,0,0,0,0}
staticprivate

◆ lines

short Nsmsg::lines
private

◆ resp

unsigned char Nsmsg::resp[CMD_SIZE+1]
private

◆ resp_4

int Nsmsg::resp_4
private

◆ start_y

short Nsmsg::start_y
private

◆ stp

const unsigned char Nsmsg::stp = {0xa5, 0x8, 0,0,0,0,0,0,0,0,0,0,0,0,0,0}
staticprivate

◆ sts

const unsigned char Nsmsg::sts = {0xa5, 0x2, 0,0,0,0,0,0,0,0,0,0,0,0,0,0}
staticprivate

◆ temp_act

float Nsmsg::temp_act
private

◆ temp_set

float Nsmsg::temp_set
private

◆ zon

const unsigned char Nsmsg::zon = {0xa5, 0x7, 0,0,0,0, 0,0,0,0, 0x1a,0x82,0,0,7,0}
staticprivate

The documentation for this class was generated from the following files: