37 #ifndef WIN32_LEAN_AND_MEAN 38 #define WIN32_LEAN_AND_MEAN 1 46 #include <sys/socket.h> 47 #include <netinet/in.h> 48 #include <arpa/inet.h> 72 void usage(
const char *programNameP)
74 fprintf(stderr,
"USAGE: %s [<options>]\n", programNameP);
75 fprintf(stderr,
"Where <options> are:\n");
76 fprintf(stderr,
"\t-a address : MultiSense IP Address (default=10.66.171.21)\n");
77 fprintf(stderr,
"\t-h height : Imager width, in px (default=544)\n");
78 fprintf(stderr,
"\t-w width : Imager height, in px (default=1024)\n");
90 std::string currentAddress =
"10.66.171.21";
92 uint32_t width = 1024;
99 while(-1 != (c =
getopt(argc, argvPP,
"a:h:w:")))
101 case 'a': currentAddress = std::string(
optarg);
break;
102 case 'h': height = atoi(
optarg);
break;
103 case 'w': width = atoi(
optarg);
break;
104 default:
usage(*argvPP);
break;
110 Channel *channelP = Channel::Create(currentAddress);
111 if (NULL == channelP) {
112 std::cerr <<
"Failed to establish communications with \"" << currentAddress <<
"\"" << std::endl;
124 std::cerr <<
"Failed to query sensor version: " << Channel::statusString(status) << std::endl;
128 std::cout <<
"API build date : " << v.
apiBuildDate <<
"\n";
129 std::cout <<
"API version : 0x" << std::hex << std::setw(4) << std::setfill(
'0') << v.
apiVersion <<
"\n";
131 std::cout <<
"Firmware version : 0x" << std::hex << std::setw(4) << std::setfill(
'0') << v.
sensorFirmwareVersion <<
"\n";
134 std::cout <<
"FPGA DNA : 0x" << std::hex << v.
sensorFpgaDna <<
"\n";
135 std::cout << std::dec;
146 std::cerr <<
"Failed to get image config: " << Channel::statusString(status) << std::endl;
154 std::cerr <<
"Failed to configure sensor: " << Channel::statusString(status) << std::endl;
162 Channel::Destroy(channelP);
uint64_t sensorHardwareMagic
void setResolution(uint32_t w, uint32_t h)
std::string sensorFirmwareBuildDate
virtual Status getVersionInfo(system::VersionInfo &v)=0
int getopt(int argc, char **argv, char *opts)
int main(int argc, char **argvPP)
static CRL_CONSTEXPR Status Status_Ok
virtual Status setImageConfig(const image::Config &c)=0
VersionType sensorFirmwareVersion
uint64_t sensorHardwareVersion
virtual Status getImageConfig(image::Config &c)=0