latest additions from elsewhere

This commit is contained in:
carl 2023-05-26 07:24:58 -03:00
parent 09d15f349e
commit cf62ee2db1
9 changed files with 1156 additions and 0 deletions

View File

@ -0,0 +1,253 @@
#include "pgmutes.h"
#include "usbutes.h"
#include "fjpvutes.h"
#define VENDOR 0x04c5
#define DEVICE 0x1526
#define IFACE 0
#define CONFIG 0
#define PICX 640
#define PICY 480
#define SKIP 8
/**
Grab palm vein prints from Fujitsu device.
You may have to run as root, or replug the device, or remove fjveincam.ko with modprobe.
Most usual key sequence:
p - take spic
t - thresholding
c - find biggest non-black area and cut the rest
k - apply kernel
e - export to file xxx.pgm
Once you have xxx.pgm
*/
int process(typImg * pImg){
normalise(pImg, 0, 255);
}
int main_loop(libusb_device_handle * hdev){
typPics * pPics;
char c = 'h';
FILE * hFile;
int cycles = 0;
pPics = (typPics *)malloc(sizeof(typPics));
memset(pPics,0,sizeof(typPics));
hFile = fopen("/dev/stdin","r");
int status = 0;
lights_off(hdev);
typImg * ptmpimg = NULL;
typImg * pkern1 = NULL;
typImg * pkern2 = NULL;
int x1,y1,x2,y2;
int kern1[] = { 1,0,-1, 3,0,-3, 1,0,-1 };
int kern2[] = { 1,3,1, 0,0,0, -1,-3,-1 };
int kern3[] = { -1,0,1, -3,0,3, -1,0,1 };
int kern4[] = { -1,-3,-1, 0,0,0, 1,3,1 };
pPics->pir = create(PICX, PICY);
pPics->pvisible = create(PICX, PICY);
pPics->pdots = create(PICX, PICY);
pPics->pmask = create(PICX, PICY);
while(c!='q'){
switch(c){
// ACQUISITION ----------
case 'P':
// GET production photos
detect(hdev,pPics);
// dots are half height for some reason
pPics->pdots->h = 240;
status = quadrant(pPics->pdots);
if (status==0){
// dots are in order
pgmascii(pPics->pir,SKIP);
}
cycles++;
break;
case 'p':
// GET test photos
detect(hdev,pPics);
pgmascii(pPics->pdots, SKIP);
pgmascii(pPics->pir, SKIP);
cycles++;
break;
// SHOW THE DATA ----------
case 'i':
// SHOW ir image
pgmascii(pPics->pir, SKIP);
break;
case 'v':
// SHOW ir image
pgmascii(pPics->pvisible, SKIP);
break;
case 'd':
// SHOW ir image
pgmascii(pPics->pdots, SKIP);
break;
// OPERATIONS ----------
case 's':
// OP smooth IR
pkern1 = create(3,3);
//ptmpimg = smooth(pPics->pkern);
pgmascii(ptmpimg, SKIP);
break;
case 'c':
// OP make new image from cross
x1 = avg(pPics->pir,0,0,pPics->pir->w,pPics->pir->h);
printf("finding cross < threshold = %d\n", x1);
pPics->pir = cross(pPics->pir, pPics->pir->mx, pPics->pir->my, x1);
pgmascii(pPics->pir , SKIP);
break;
case 'n':
// OP normalise ir
pPics->pir = normalise(pPics->pir, 0 , 255);
pgmascii(pPics->pir, SKIP);
break;
case 'l':
// OP linear filters
pPics->pir = linear10(pPics->pir, 10);
pgmascii(pPics->pir, SKIP);
break;
case 't':
// OP remove low light by threshold
pgmascii(pPics->pir, SKIP);
pPics->pir = threshold(pPics->pir,50,200,0,255);
pgmascii(pPics->pir , SKIP);
break;
case 'k':
// OP apply kernels
pkern1 = create(3,3);
pkern2 = create(3,3);
arrload(pkern1, kern1);
arrload(pkern2, kern2);
pgmsave(pPics->pir, "k0.pgm");
pPics->pdots = convolve(pPics->pir, pkern1, 0);
pgmsave(pPics->pdots, "k1.pgm");
pPics->pdots = convolve(pPics->pir, pkern2, 0);
pgmsave(pPics->pdots, "k2.pgm");
arrload(pkern1, kern3);
arrload(pkern2, kern4);
pgmsave(pPics->pdots, "k3.pgm");
pPics->pdots = convolve(pPics->pir, pkern1, 0);
pgmsave(pPics->pdots, "k4.pgm");
pPics->pdots = convolve(pPics->pir, pkern2, 0);
pgmsave(pPics->pdots, "k5.pgm");
break;
case 'u':
// OP remove encrypted strip of data
unmask(pPics->pir);
break;
// FILE I/O ----------
case 'e':
// IO export to PGM
pgmsave(pPics->pir, "ir.pgm");
pgmsave(pPics->pvisible, "vis.pgm");
//pgmsave(pPics->pxxx, "xxx.pgm");
break;
case 'f':
// IO read ir PGM
pPics->pir = pgmload("ir.pgm");
break;
case 'h':
// help
printf("p - GET production ir acquisition\n");
printf("t - GET test (quick and dirty) ir acquisition\n");
printf("\n");
printf("v - SHOW visible dump\n");
printf("i - SHOW infra red dump\n");
printf("d - SHOW dot dump\n");
printf("m - SHOW mask dump\n");
printf("c - SHOW calib dump\n");
printf("\n");
printf("a - OP acquire mask from ir\n");
printf("u - OP unmask last ir pic\n");
printf("\n");
printf("s - IO save mask to file\n");
printf("r - IO read mask from file\n");
printf("e - IO export ir to palm.pgm\n");
printf("h - this help\n");
printf("q - quit\n");
printf("\n");
printf("calibration:\n");
printf(" i until you get the darkest image\n");
printf(" m to extract the mask\n");
printf(" s to save\n");
printf(" r to reload (optional)\n");
printf(" p until you get a good scan\n");
break;
case '\n':
break;
default: printf("Error. %c ?? Try h for help.\n", c);
break;
}
c = fgetc(hFile);
}
fclose(hFile);
return cycles;
}
/**
Main is at the bottom becuase it needs all the functions to come first.
This saves us the hassle of header files while the program is still simple.
*/
int main(int argc, char * argv[]){
int rc = 0;
int traffic = 0;
int verbose = 1;
int i = 0;
typUSB * pUSB;
pUSB = (typUSB *)malloc(sizeof(typUSB));
memset(pUSB,0,sizeof(typUSB));
pUSB->debug = 1;
printf("libusb_init\n");
rc = libusb_init(&pUSB->pctx);
libusb_set_debug(pUSB->pctx,3);
rc = usbopen(pUSB, VENDOR, DEVICE, IFACE, CONFIG);
if (rc != 0){
printf("Couldnt open the device with code %d. Exiting.", rc);
exit(rc);
}
// custom code
printf("ps prep\n");
prep(pUSB->hdev);
rc = main_loop(pUSB->hdev);
printf("main loop exits code %d\n",rc);
// end custom code
rc = usbclose(pUSB);
}
/**
Copyright (c) Atlantean Technical Solutions Limited (ATSL) 2022
This software has been produced by ATSL and is the copyright of ATSL. The
use of source code for the software is strictly governed by the terms and
conditions of the source code licence. Any unauthorised use of the source
source code for the software in any manner shall invalidate the licence,
any existing warranty and software support agreements by ATSL.
@proj usbutes
@subsys CCL
@file ccl.c
@brief <B> *** Useful general purpose common C functions *** </B>
@author GoodwinC
@date 2022-10-27
@spec N.A
*/

View File

@ -0,0 +1,256 @@
#include "usbutes.h"
#include "fjpvutes.h"
#include "pgmutes.h"
void unmask(typImg * p){
int i = 0;
for (i=0; i< p->w; i++){
*(p->imgc + PICSIZ/4 + i) = ( *(p->imgc + PICSIZ/4 - p->w + i)
+ *(p->imgc + PICSIZ/4 + p->w + i) ) /2;
}
}
int quadrant(typImg * pImg) {
int i = 0;
int j = 0;
int val = 0;
// q1 q3
// q2 q4
int q1 = 0;
int q2 = 0;
int q3 = 0;
int q4 = 0;
unsigned char * p = pImg->imgc;
int h = pImg->h;
int w = pImg->w;
int div = w*h/4;
for (i=0; i<h; i++){
for (j=0; j<w; j++){
val = p[i*w + j] ;
if (i<h/2 && j<w/2){
q1+=val;
}
if (i>h/2 && j<w/2){
q2+=val;
}
if (i<h/2 && j>w/2){
q3+=val;
}
if (i>h/2 && j>w/2){
q4+=val;
}
}
}
q1 = (int)(q1/(div));
q2 = (int)(q2/(div));
q3 = (int)(q3/(div));
q4 = (int)(q4/(div));
printf("quadrants: %d %d %d %d \n", q1, q2, q3 ,q4);
if (q1<TOOFAR && q2<TOOFAR && q3<TOOFAR && q4<TOOFAR){
printf("too far - move hand nearer\n");
return 1;
}
if (q1>TOONEAR && q2>TOONEAR && q3>TOONEAR && q4>TOONEAR){
printf("too near - move hand away\n");
return 2;
}
if (q1 > q2 && q3 > q4){
printf("pitch - make your hand flatter\n");
return 3;
}
if (q1 > q2 && q3 > q4){
printf("pitch - make your hand flatter\n");
return 4;
}
if (q1 < q3 && q2 < q4){
printf("roll - make your hand flatter\n");
return 5;
}
if (q1 > q3 && q2 > q4){
printf("roll - make your hand flatter\n");
return 6;
}
printf("******************* GOOD SCAN *****************\n");
return 0;
}
// PALMSECURE : make some preparations (security stuff)
int prep(libusb_device_handle * hdev) {
int res= 0;
int i = 0;
int j = 0;
unsigned char * p;
char device_key[18];
unsigned char mask[PICSIZ];
memset(&mask,0,sizeof(mask));
printf(" preamble with device handle at %p\n", hdev);
p = ctlxfer(hdev, 0xc0, 0xa0, 0, 0, 3); // returns a0 00 cb <- defo needed
//p = ctlxfer(hdev, 0xc0, 0x29, 0, 0, 4); // returns 29 00 03 00 (probably means "flag value is 3") seems_redundanct
//p = ctlxfer(hdev, 0xc0, 0x66, 0, 0, 3); // returns 66 00 00 seems_redundanct
//p = ctlxfer(hdev, 0xc0, 0xa3, 0, 0, 4); // returns a3 92 cd 01 seems_redundanct
printf("I**** PalmSecure: Connected to device\n");
//p = ctlxfer(hdev, 0xc0, 0x29, 1, 4, 4); // returns 29010400 (probably means "flag value is 4") appears to switch on encryption, so seems redundant
// We initialize device's random generator with this method, it seems
//p = ctlxfer(hdev, 0xc0, 0x35, rand() % 0xffff, rand() % 0xffff, sizeof(device_key)); // returns 3500 + encryption key seems_redundanct
printf("***SEC KEY*** (different for every device)\n");
hexdump(p,sizeof(device_key),1);
memcpy(&device_key, p+2, sizeof(device_key));
printf("*************\n");
// send a blank mask
//p = ctlxfer(hdev, 0xc0, 0x36, 0, 0, 3); seems_redundanct
//res = bulkSend(hdev, 0x01, mask, sizeof(mask)); seems_redundanct
//ctlxfer(hdev, 0xc0, 0x29, 1, 0, 4); // returns 29010400 (probably means something)
//ctlxfer(hdev, 0xc0, 0xf6, 9, 0, 168); // returns a400000002000000d0051000b7071000d7a3703d0ad7fd3fd7a3703d0ad7a
//33f6666666666565e401c041000f80410003108ac1c5a640040367689eaad81ad3f713d0ad7a3605540e80210004b031000f0a7c64b378901404faf946588
//63b53f52b81e85eb314e400e0210003e021000fed478e9263102406002b7eee6a9be3fae47e17a144e4540740110008c011000cff753e3a59b024024624a2
//4d1cbc43f0ad7a3703d0a3e40
//ctlxfer(hdev, 0xc0, 0xf6, 8, 0, 152); // returns 9400000001000000000000000000004000000000000032400000000000008
//4400000000000007e40fa7e6abc7493783f0038b1e02533833fccc5bd1f468d54bf00001ae91ded883f00ac11642c67ed3f4ba5ca32f867b0bfc42951a36f
//36793f34fe9ffa4662f43fe3d40ddaa64bd53f9b186be9afb2d9bf693754c7b3e55240aee258d2929a67bf504164df91a63dbf953ead43900be9bf seems_redundanct
//ctlxfer(hdev, 0xc0, 0xf6, 7, 0, 302); // returns 3401000001000000040000000000000061e849533fe226c0190e2d82fc282
//7c00000000000000000094155c358418b3f60805047ad44513fd6fd521d45ffef3f7eb6d422de042740cdccd212dc4a27c00000000000000000433ed92b61
//9f7b3f0f25c8d5ce9661bf3816387acbffef3f29a96ce37edc26c072cc748eef102740000000000000000082f2c7d86e53933f9a4c9416e67b8a3f77fc491
//6dbfdef3fac1796de70ed2640e428b29c3ce02640000000000000000033f14bd221639f3ffd970612085827bf5f59a39326fcef3f020004004201f0004201
//ef004301f5004801f20000000000d2a12dffc12342400901b700f800a6007b01b6008c01a5000a012e01fa003e0180012a0191013b01bff27cd4352453402
//901d7001d01cb005b01d6006701ca002a010e011f01 seems_redundanct
lights_off(hdev);
printf("PalmSecure: preparations done");
return 0;
}
// PALMSECURE : get an image
unsigned char * capture_on(libusb_device_handle * pdev) {
printf("Capture!");
//ctlxfer(pdev, 0xc0, 0x4e, 0, 0, 3); // returns 4e0100 seems_redundanct
//ctlxfer(pdev, 0xc0, 0x4e, 1, 0, 3); // returns 4e0100 seems_redundanct
//ctlxfer(pdev, 0xc0, 0x4e, 2, 0, 3); // returns 4e0100 seems_redundanct
//ctlxfer(pdev, 0xc0, 0x4e, 3, 0, 3); // returns 4e0100 seems_redundanct
//ctlxfer(pdev, 0xc0, 0x46, 0x5d0, 0, 3); // returns 460100 seems_redundanct
//ctlxfer(pdev, 0xc0, 0x47, 0x10, 0, 3); // returns 470100 seems_redundanct
//ctlxfer(pdev, 0xc0, 0x49, 0x100, 0, 3); // returns 490100 seems_redundanct
//ctlxfer(pdev, 0xc0, 0x4a, 0x78, 1, 5); // returns 4a01005802 - height of encrypted region > 0 seems_redundanct
//ctlxfer(pdev, 0xc0, 0x46, 0xc8, 3, 3); // returns 460100 seems_redundanct
//ctlxfer(pdev, 0xc0, 0x47, 0x10, 3, 3); // returns 470100 seems_redundanct
//ctlxfer(pdev, 0xc0, 0x49, 0x100, 3, 3); // returns 490100 seems_redundanct
ctlxfer(pdev, 0xc0, 0x42, 0x100, 2, 3); // returns 420100 seems_needed
ctlxfer(pdev, 0xc0, 0x43, 0, 0, 3); // returns 430100 < defo needed
ctlxfer(pdev, 0xc0, 0x4a, 0, 480, 5); // returns 4a0100b004 - image height? < defo needed
}
//
int lights_on(libusb_device_handle * hdev) {
// switch on lights?
//ctlxfer(hdev, 0xc0, 0x27, 0x07, 1, 8); // returns 2707000000000000 seems_redundanct
//ctlxfer(hdev, 0xc0, 0x27, 0x08, 1, 8); // returns 2708000000000000 seems_redundanct
//ctlxfer(hdev, 0xc0, 0x27, 0x00, 1, 6); // returns 270000280000 seems_redundanct
}
int lights_off(libusb_device_handle * hdev) {
// switch off all lights?
//ctlxfer(hdev, 0xc0, 0x27, 0, 0, 6); // returns 270000000000 seems_redundanct
//ctlxfer(hdev, 0xc0, 0x27, 0x05, 0, 8); // returns 2705000000000000 seems_redundanct
//ctlxfer(hdev, 0xc0, 0x27, 0x06, 0, 8); // returns 2706000000000000 seems_redundanct
//ctlxfer(hdev, 0xc0, 0x27, 0x07, 0, 8); // returns 2707000000000000 seems_redundanct
//ctlxfer(hdev, 0xc0, 0x27, 0x08, 0, 8); // returns 2708000000000000 seems_redundanct
//ctlxfer(hdev, 0xc0, 0x27, 0x09, 0, 8); // returns 2709000000000000 seems_redundanct
//ctlxfer(hdev, 0xc0, 0x27, 0x0a, 0, 8); // returns 270a000000000000 seems_redundanct
//ctlxfer(hdev, 0xc0, 0x27, 0x0b, 0, 8); // returns 270b000000000000 seems_redundanct
//ctlxfer(hdev, 0xc0, 0x27, 0x0c, 0, 8); // returns 270c000000000000 seems_redundanct
}
int fuzz(libusb_device_handle * hdev, typPics * pPics){
int i = 0;
unsigned char * p;
for (i=0; i< 255; i++){
printf("%d %x %d %d\n", 0xc0, 0x44, i, 0);
ctlxfer(hdev, 0xc0, 0x27, 0, i, 6); // returns 440100b00400
p = bulkReceive(hdev, 2, PICSIZ); // normal picture
memcpy(pPics->pvisible->imgc,p,PICSIZ);
pgmascii(pPics->pvisible, 16);
sleep(1);
}
}
int detect(libusb_device_handle * hdev, typPics * pPics) {
//ctlxfer(hdev, 0xc0, 0x4d, 0x78, 240, 5); // resize returns 4d01005802 seems_redundanct
//ctlxfer(hdev, 0xc0, 0x58, 0, 0xf0f, 56);
// returns 5801000000000808080808090809090808080809080908090808090807080808080808080808080909080908080908080808080808080800
unsigned char * p;
unsigned char * q;
unsigned char * r;
int i = 0;
capture_on(hdev);
//lights_on(hdev);
printf("\n==== Visible Spectrum capture\n");
ctlxfer(hdev, 0xc0, 0x44, 0, 1, 6); // returns 440100b00400
p = bulkReceive(hdev, 2, PICSIZ); // normal picture
memcpy(pPics->pvisible->imgc,p,PICSIZ);
printf("\n==== Regular IR capture\n");
ctlxfer(hdev, 0xc0, 0x44, 0, 0, 6); // returns 440100b00400
p = bulkReceive(hdev, 2, PICSIZ); // IR picture
ctlxfer(hdev, 0xc0, 0x44, 0, 0, 6); // returns 440100b00400
q = bulkReceive(hdev, 2, PICSIZ); // IR picture
ctlxfer(hdev, 0xc0, 0x44, 0, 0, 6); // returns 440100b00400
r = bulkReceive(hdev, 2, PICSIZ); // IR picture
for (i=0; i<PICSIZ; i++){
*(pPics->pir->imgc + i) = (unsigned char)((*(p+i) + *(q+i) + *(r+i)) / 3);
}
pgmascii(pPics->pir,16);
printf("\n==== Dots\n");
ctlxfer(hdev, 0xc0, 0x4d, 0x78, 240, 5); // returns 4d01005802
ctlxfer(hdev, 0xc0, 0x44, 3, 2, 6); // returns 440100580200
p = bulkReceive(hdev, 2, PICSIZ/2); // "4 dots"
memcpy(pPics->pdots->imgc,p,PICSIZ/2);
// lights_off(hdev);
}
/**
Copyright (c) Atlantean Technical Solutions Limited (ATSL) 2022
This software has been produced by ATSL and is the copyright of ATSL. The
use of source code for the software is strictly governed by the terms and
conditions of the source code licence. Any unauthorised use of the source
source code for the software in any manner shall invalidate the licence,
any existing warranty and software support agreements by ATSL.
@proj usbutes
@subsys CCL
@file ccl.c
@brief <B> *** Useful general purpose common C functions *** </B>
@author GoodwinC
@date 2022-10-27
@spec N.A
*/

View File

@ -0,0 +1,160 @@
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/usb.h>
#define CGU18
#ifdef CGU18
#include <linux/uaccess.h>
#endif
//https://sysplay.in/blog/linux-device-drivers/2014/02/usb-drivers-in-linux-data-transfer-to-from-usb-devices/
#define MIN(a,b) (((a) <= (b)) ? (a) : (b))
#define BULK_EP_OUT 0x01
#define BULK_EP_IN 0x82
#define MAX_PKT_SIZE 512
static struct usb_device *device;
static struct usb_class_driver class;
static unsigned char bulk_buf[MAX_PKT_SIZE];
static int usb_fjveincam_open(struct inode *i, struct file *f)
{
printk(KERN_NOTICE "fjveincam open");
return 0;
}
static int usb_fjveincam_close(struct inode *i, struct file *f)
{
printk(KERN_NOTICE "fjveincam close");
return 0;
}
static ssize_t usb_fjveincam_read(struct file *f, char __user *buf, size_t cnt, loff_t *off)
{
int retval;
int read_cnt;
printk(KERN_NOTICE "fjveincam read");
/* Read the data from the bulk endpoint */
retval = usb_bulk_msg(device, usb_rcvbulkpipe(device, BULK_EP_IN),
bulk_buf, MAX_PKT_SIZE, &read_cnt, 5000);
if (retval)
{
printk(KERN_ERR "Bulk message returned %d\n", retval);
return retval;
}
if (copy_to_user(buf, bulk_buf, MIN(cnt, read_cnt)))
{
return -EFAULT;
}
return MIN(cnt, read_cnt);
}
static ssize_t usb_fjveincam_write(struct file *f, const char __user *buf, size_t cnt,
loff_t *off)
{
int retval;
int wrote_cnt = MIN(cnt, MAX_PKT_SIZE);
printk(KERN_NOTICE "fjveincam write");
#ifdef CGU18
if (copy_from_user(bulk_buf, buf, MIN(cnt, MAX_PKT_SIZE)))
#else
if (copy_from_user(bulk_buf, buf, MIN(cnt, MAX_PKT_SIZE)))
#endif
{
return -EFAULT;
}
/* Write the data into the bulk endpoint */
retval = usb_bulk_msg(device, usb_sndbulkpipe(device, BULK_EP_OUT),
bulk_buf, MIN(cnt, MAX_PKT_SIZE), &wrote_cnt, 5000);
if (retval)
{
printk(KERN_ERR "Bulk message returned %d\n", retval);
return retval;
}
return wrote_cnt;
}
static struct file_operations fops =
{
.owner = THIS_MODULE,
.open = usb_fjveincam_open,
.release = usb_fjveincam_close,
.read = usb_fjveincam_read,
.write = usb_fjveincam_write,
};
static int usb_fjveincam_probe(struct usb_interface *interface, const struct usb_device_id *id)
{
int retval;
device = interface_to_usbdev(interface);
printk(KERN_NOTICE "fjveincam probe");
class.name = "usb/pen%d";
class.fops = &fops;
if ((retval = usb_register_dev(interface, &class)) < 0)
{
/* Something prevented us from registering this driver */
printk(KERN_ERR "Not able to get a minor for this device.");
}
else
{
printk(KERN_INFO "Minor obtained: %d\n", interface->minor);
}
return retval;
}
static void usb_fjveincam_disconnect(struct usb_interface *interface)
{
printk(KERN_NOTICE "fjveincam disconnect");
usb_deregister_dev(interface, &class);
}
/* Table of devices that work with this driver */
static struct usb_device_id usb_fjveincam_table[] =
{
{ USB_DEVICE(0x058F, 0x6387) },
{} /* Terminating entry */
};
MODULE_DEVICE_TABLE (usb, usb_fjveincam_table);
static struct usb_driver usb_fjveincam_driver =
{
.name = "usb_fjveincam_driver",
.probe = usb_fjveincam_probe,
.disconnect = usb_fjveincam_disconnect,
.id_table = usb_fjveincam_table,
};
static int __init usb_fjveincam_init(void)
{
int result;
printk(KERN_NOTICE "fjveincam init");
/* Register this driver with the USB subsystem */
if ((result = usb_register(&usb_fjveincam_driver)))
{
printk(KERN_ERR "usb_register failed. Error number %d", result);
}
return result;
}
static void __exit usb_fjveincam_exit(void)
{
printk(KERN_NOTICE "fjveincam exit");
/* Deregister this driver with the USB subsystem */
usb_deregister(&usb_fjveincam_driver);
}
module_init(usb_fjveincam_init);
module_exit(usb_fjveincam_exit);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Carl Goodwin <cg@dispension.com>");
MODULE_DESCRIPTION("USB Pen Device Driver");

View File

@ -0,0 +1,324 @@
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <libusb.h>
#include "usbutes.h"
#define PICSIZ 307200
#define TIMEOUT 2000
#define PKTSIZ 512
// Arbitrarily dump hex
void hexdump(unsigned char * p, int n, int step){
int i = 0;
int l = 0;
for (i=0; i<n; i+=step) {
printf("%02x ",*(p+i));
}
printf("\n");
}
// Arbitrarily dump an image as ASCII on the console - convenient quick testing
void imgdump(unsigned char p[], int w, int h, int s){
int i = 0;
int j = 0;
int val = 0;
char pix[] = " .,:;iI#";
printf("dumping %dx%d step %d\n",w,h,s);
for (i=0; i<h; i+=s){
for (j=0; j<w; j+=s){
val = p[i*w + j] ;
printf("%c ", pix[ (int)(val/35) ] );
//printf("%d > %d %d %c\n", i*w + j, i, j, p[i*w + j] );
}
printf("\n");
}
}
// GENERIC : Send a command to the device and deal with the (short) response
unsigned char * ctlxfer(libusb_device_handle * hdev, uint bmReqType, uint bReq, uint wVal, uint wIx, int wLen) {
int res = 0;
int debug = 1;
static unsigned char ibuf[BUFSIZ];
if (debug==1){
printf("usb ctl xfer rtyp=%02x req=%02x | val=%d ix=%d | len=%d ...\n", bmReqType, bReq , wVal, wIx, wLen);
}
memset(&ibuf,0,sizeof(ibuf));
res = libusb_control_transfer(hdev, bmReqType, bReq, wVal, wIx, ibuf, wLen, TIMEOUT);
printf("RECV %d / %d:\n", res, wLen);
if (res != wLen){
printf("W**** libusb control transfer returned %d bytes with %d expected\n", res, wLen);
*(ibuf + wLen) = 0;
}
if (debug==1){
hexdump(ibuf,res,1);
}
return ibuf;
}
// GENERIC : Send a buffer to the device
int bulkSend(libusb_device_handle * pdev, int endpoint, unsigned char * obuf, int len) {
int res = 0;
int sent = 0;
int tx = 0;
//printf("usb bulk xfer to %d = %d bytes ...\n", endpoint, len);
while(sent < len) {
res = libusb_bulk_transfer(pdev, endpoint & 0x7f, obuf + sent, PKTSIZ, &tx, 0);
if (res < 0) {
printf("libusb bulk send failed\n");
return -1;
}
if (tx < 1){
return -1;
}
sent += tx;
}
//printf("SENT %d / %d:\n", sent, len);
return sent;
}
// GENERIC : get a buffer from the device
unsigned char * bulkReceive(libusb_device_handle * pdev, int endpoint, int len) {
int tx = 0;
int res = 0;
static unsigned char ibuf[PICSIZ];
// ibuf = (unsigned char *)malloc(len);
memset(&ibuf,0,sizeof(ibuf));
int recvd = 0;
//printf("usb bulk receive from %d = %d bytes ...\n", endpoint, len);
while(len > recvd) {
int res = libusb_bulk_transfer(pdev, endpoint | 0x80, ibuf + recvd, PKTSIZ, &tx, 0);
if (res < 0) {
printf("libusb bulk receive failed\n");
return NULL;
}
if (tx < 1){
return NULL;
}
recvd += tx;
}
//printf("RECV %d / %d:\n", recvd, len);
return ibuf;
}
// GENERIC: Scan for all usb devices
int usbscan(libusb_context * pctx){
libusb_device **dlist = NULL;
libusb_device * pdevice = NULL;
struct libusb_device_descriptor desc;
int count = 0;
int rc = 0;
printf("usb device list\n");
count = libusb_get_device_list(pctx, &dlist);
int i = 0;
for (i = 0; i < count; ++i) {
pdevice = dlist[i];
rc = libusb_get_device_descriptor(pdevice, &desc);
printf("Vendor:Device = %04x:%04x\n", desc.idVendor, desc.idProduct);
}
libusb_free_device_list(dlist, count);
}
// GENERIC: Get some information about the target device
void usbstats( libusb_device_handle * hdev, libusb_device * pdev, int ifaceno){
int rc = 0;
struct libusb_config_descriptor * pconfig;
struct libusb_device_descriptor dev_desc;
struct libusb_config_descriptor *conf_desc;
int bus = 0;
printf("libusb_get_bus\n");
bus = libusb_get_bus_number(pdev);
// get generic usb device data
rc = libusb_kernel_driver_active(hdev, ifaceno);
//rc = libusb_detach_kernel_driver(hdev, 0);
printf("\nDevice descriptors:\n");
libusb_get_device_descriptor(pdev, &dev_desc);
printf(" kernel attached: %d\n", rc);
printf(" bus: %d\n", bus);
printf(" length: %d\n", dev_desc.bLength);
printf(" device class: %d\n", dev_desc.bDeviceClass);
printf(" S/N: %d\n", dev_desc.iSerialNumber);
printf(" VID:PID: %04X:%04X\n", dev_desc.idVendor, dev_desc.idProduct);
printf(" bcdDevice: %04X\n", dev_desc.bcdDevice);
printf(" iMan:iProd:iSer: %d:%d:%d\n", dev_desc.iManufacturer, dev_desc.iProduct, dev_desc.iSerialNumber);
printf(" nb confs: %d\n", dev_desc.bNumConfigurations);
rc = libusb_get_device_speed(pdev);
printf(" speed: %d\n", rc);
rc = libusb_get_config_descriptor(pdev, 0, &conf_desc);
printf(" interfaces: %d\n", conf_desc->bNumInterfaces);
libusb_free_config_descriptor(conf_desc);
}
void usbdump(typUSB * pUSB){
printf(" context pctx: %p\n", pUSB->pctx);
printf(" handle hdev: %p\n", pUSB->hdev);
printf(" pointer pdev: %p\n", pUSB->pdev);
printf(" interface #: %d\n", pUSB->iface);
printf(" config #: %d\n", pUSB->config);
printf(" vendor #: %04x\n", pUSB->vendor);
printf(" device #: %04x\n", pUSB->device);
}
int ddusbopen(typUSB * pUSB, int vendor, int device, int ifaceno, int config){
int rc = 0;
int i = 0;
int VENDOR = 0x04c5;
int DEVICE = 0x1526;
int IFACE = 0;
int CONFIG = 0;
printf("libusb_open\n");
pUSB->hdev = libusb_open_device_with_vid_pid(pUSB->pctx, VENDOR, DEVICE);
if (pUSB->hdev==NULL){
printf("libusb open failed for %x %x\n", VENDOR, DEVICE);
}
printf("libusb_get_device\n");
pUSB->pdev = libusb_get_device(pUSB->hdev);
if (pUSB->pdev==NULL){
printf("libusb get device failed for %x %x\n", VENDOR, DEVICE);
}
printf("available device list:\n");
rc = libusb_reset_device(pUSB->hdev);
printf("reset rc = %d ;\n", rc);
//rc = libusb_set_interface_alt_setting(pdev, ALTFACE, alt);
for (i=0; i<4; i++){
printf("libusb_claim interface %d try %d...\n", IFACE, i);
rc = libusb_claim_interface(pUSB->hdev, IFACE);
if (rc==0){
break;
}
sleep(1);
}
printf("claim rc = %d ;\n", rc);
printf("claim rc = %d ; libusb_set_config...\n", rc);
rc = libusb_set_configuration(pUSB->hdev, CONFIG);
printf("setconf rc=%d; libusb_reset...\n", rc);
return 0;
}
int usbopen(typUSB * pUSB, int vendor, int device, int ifaceno, int config){
//static struct libusb_interface iface;
int i=0;
int rc=0;
printf("libusb_init called...\n");
//rc = libusb_init(&(pUSB->pctx));
//libusb_set_debug(pUSB->pctx,3);
pUSB->iface = ifaceno;
pUSB->config = config;
pUSB->vendor = vendor;
pUSB->device = device;
// open
printf("libusb_open [[if it fails, check your permissions - run as root?]\n");
pUSB->hdev = libusb_open_device_with_vid_pid(pUSB->pctx, vendor, device);
if (pUSB->hdev==NULL){
printf("*** libusb open failed for %x %x\n", vendor, device);
return 1;
}
// get generic usb device data
rc = libusb_kernel_driver_active(pUSB->hdev, ifaceno);
printf("active check rc=%d; libusb_reset...\n", rc);
//rc = libusb_detach_kernel_driver(pUSB->hdev, ifaceno);
if (rc != 0){
printf("**** Warning: libusb interface %d kernel detach failed with code %d\n", ifaceno, rc);
}
// get device
printf("libusb_get_device\n");
pUSB->pdev = libusb_get_device(pUSB->hdev);
if (pUSB->pdev==NULL){
printf("**** libusb get device failed for %x %x\n", vendor, device);
return 2;
}
printf("available device list:\n");
usbscan(pUSB->pctx);
usbstats(pUSB->hdev,pUSB->pdev, ifaceno);
// set generic usb config
rc = libusb_reset_device(pUSB->hdev);
printf("reset rc = %d ;\n", rc);
//rc = libusb_set_interface_alt_setting(pdev, ALTFACE, alt);
for (i=0; i<4; i++){
printf("libusb_claim interface %d try %d...\n", ifaceno, i);
rc = libusb_claim_interface(pUSB->hdev, ifaceno);
if (rc==0){
break;
} else {
printf("**** Bad claim on interface %d with code %d\n", ifaceno, rc);
}
sleep(1);
}
printf("claim rc = %d ; libusb_set_config...\n", rc);
// set configuration
rc = libusb_set_configuration(pUSB->hdev, config);
if (rc != 0){
printf("W**** libusb config %d could not be set with code %d\n", config, rc);
}
printf("setconf rc=%d; libusb_reset...\n", rc);
usbdump(pUSB);
return 0;
}
int usbclose(typUSB * pUSB){
// generic usb close
int rc=0;
printf("libusb_release\n");
rc = libusb_release_interface(pUSB->hdev, pUSB->iface);
printf("libusb_close\n");
libusb_close(pUSB->hdev);
printf("libusb_exit\n");
libusb_exit(pUSB->pctx);
return rc;
}
/**
Copyright (c) Atlantean Technical Solutions Limited (ATSL) 2022
This software has been produced by ATSL and is the copyright of ATSL. The
use of source code for the software is strictly governed by the terms and
conditions of the source code licence. Any unauthorised use of the source
source code for the software in any manner shall invalidate the licence,
any existing warranty and software support agreements by ATSL.
@proj usbutes
@subsys CCL
@file ccl.c
@brief <B> *** Useful general purpose common C functions *** </B>
@author GoodwinC
@date 2022-10-27
@spec N.A
*/

1
modules/dispalm Submodule

@ -0,0 +1 @@
Subproject commit 5338f48ca85f0e898124e4ead70f4a0bb819ac80

79
modules/foo Normal file
View File

@ -0,0 +1,79 @@
-64.21522569999999| 45.8337327|Amherst Masonic Temple|ACACIA NO. 8 |1 |TH| 7:30pm
-64.21522569999999| 45.8337327|Amherst Masonic Temple|ALEXANDRA NO. 87 |2 |TH |WINTER||| 7:30pm||
-64.3779253| 45.6916596|River Hebert Masonic Temple||2 |TU |WINTER| 7:30pm||
-63.9030496| 45.674388|River Philip Masonic Hall|WIDOWS SON NO. 48 |3 |TU |WINTER | 7:30pm
-63.9030496| 45.674388|River Philip Masonic Hall|LAURIE NO. 70 |3 |MO | 7:30pm
-63.9030496| 45.674388|River Philip Masonic Hall| WIMBURN NO. 75 |3 |WE |WINTER | 8:00pm
-63.47463149999999| 45.8136695|Wallace Masonic Hall|WALLACE NO. 76 |2 |MO |SUMMER | 7:30pm
-64.326978| 45.403488|Parrsboro Masonic Temple |MINAS NO. 67 |3 |MO |WINTER | 7:30pm
-63.2557856| 45.3770137|Tru-Fel Masonic Building|TRURO NO. 43 |1 |MO |WINTER 1st |TU of September| 7:30pm
-63.2557856| 45.3770137|Tru-Fel Masonic Building|CORINTHIAN NO. 63 |2 |TU |WINTER||| 7:30pm
-63.2557856| 45.3770137|Tru-Fel Masonic Building|FELLOWSHIP NO. 112 |4 |TU |WINTER | 7:30pm
-62.9978149| 45.2180445|Upper Stewiacke Masonic Hall|ELM NO. 115 |3 |TU |SUMMER | 7:30pm
-63.60476999999999| 45.47619400000001|Londonderry Masonic Hall|NORTH STAR NO. 74 |1 |TH | 7:30pm
-62.6329629| 45.5956026|New Glasgow Masonic Temple|ALBION NO. 5 |2 |WE| 7:30pm||
-62.54647| 45.5647324|IOOF Hall|HUDSON NO. 77 |4 |TH |WINTER | 7:30pm
-62.65979350000001| 45.5588486|Stellarton Masonic Hall|KEITH NO. 23 |1 |MO |WINTER | 7:30pm
-62.7199706| 45.5524169|Westville Masonic Hall|NEW CALEDONIA NO. 11 |4 |MO| 7:30pm
-62.7199706| 45.5524169|Westville Masonic Hall|/ WESTERN STAR NO. 50 |2 |TU |WINTER | 7:30pm||
-61.4997133| 45.3905849|Guysborough Masonic Temple|EASTERN LIGHT NO. 72 |2 |WE | 7:30pm
-61.9842701| 45.1409217|Sherbrooke Masonic Hall|QUEENS NO. 34 |1 |TU | 7:30pm
-61.6554881| 45.1746132|Isaacs Harbour Masonic Hall |STORMONT NO. 96  |1 |FR | 7:30pm
-60.36273000000001| 45.71933000000001|Framboise Community Hall|HEATHER NO. 124 |1 |TU | 7:00pm
-61.1197265| 45.973839|Whycocomagh Masonic Hall|SIRCOM NO. 66 |1 |TH | 8:00pm
-61.3609338| 45.6127003|Port Hawkesbury Masonic Temple|SOLOMON NO. 46 |3 |TU | 7:30pm
-60.752469| 46.10155899999999|Baddeck Masonic Hall|ST MARKS NO. 35 |3 |TH |WINTER | 7:00pm
-60.26111059999999| 46.2085269|North Sydney Masonic Hall|ROYAL OAK NO. 85 |1 |FR |SUMMER | 7:30pm
-60.1961889| 46.1404083|Sydney Masonic Building|SYDNEY NO. 84 |1 |MO| 7:30pm
-60.1961889| 46.1404083|Sydney Masonic Building|/  EAST GATE NO. 127 |4 |TH | 7:30pm ||
-59.95606999999999| 46.19587|Glace Bay Masonic Hall|THE TYRIAN YOUTH NO. 45 |4 |TU except July and August and on the |3 |TH in December | 7:30pm
-59.9729396| 45.9199419|Louisbourg United Church Hall |MARINERS NO. 80  |2 |WE |WINTER | 7:30pm
-60.26111059999999| 46.2085269|North Sydney Masonic Building |ROYAL ALBERT NO. 19  |3 |MO |WINTER | 7:30pm
-59.8712108| 46.1354279|Port Morien Masonic Hall |THE THISTLE NO. 36 |1 |WE |WINTER | 7:30pm
-63.83683| 44.8992999|Mount Uniacke Masonic Hall|UNIACKE NO. 128 |2 |TU | 7:30pm
-63.5057413| 44.9697496|Elmsdale Masonic Hall|C.W. SAUNDERS NO. 125 |3 |WE |WINTER | 7:30pm
-64.1935491| 45.0717577|Hants Border Community Hall|POYNTZ LODGE NO. 44 |1 |TH except in July and August | 7:30pm
-64.0988741| 44.9641069|Three Mile Plains Community Hall|| 7:30pm ||
-63.49304540000001| 45.3165583|Maitland Masonic Hall|W.D. LAWRENCE NO. 101  |2 |MO except January and February | 7:30pm
-64.12030399999999| 44.990262|Windsor Masonic Temple|
-63.10260249999999| 44.7847089|Ashlar Masonic Hall|ASHLAR NO. 107 |1 |TU |WINTER | 8:00pm
-63.6552872| 44.7304261|Bedford Masonic Hall|BEDFORD NO. 104 |3 |MO |WINTER | 7:00pm
-63.6552872| 44.7304261|Bedford Masonic Hall|BEDFORD/ JOHN ALBRO NO. 122 |4 |TH |WINTER| 7:30pm||
-63.6552872| 44.7304261|Bedford Masonic Hall|BEDFORD/ CORNWALLIS NO. 95 |3 |TU except July and August | 7:30pm
-63.6552872| 44.7304261|Bedford Masonic Hall|BEDFORD/ WENTWORTH NO. 108 |3 |TH except December is |1 |TH | 7:00pm
-63.6552872| 44.7304261|Bedford Masonic Hall|BEDFORD/ WOODLAWN NO. 131 |2 |TH |WINTER | 7:30pm
-63.6552872| 44.7304261|Bedford Masonic Hall|LODGE LA FRANCE NO. 138 4th |FR of March| May| June
-62.520556| 44.9205021|Sheet Harbour Masonic Hall|EUREKA NO. 42 |4 |WE Every Month except January and February| 7:30pm||
-63.6941795| 44.781549|Sackville Masonic Temple|SACKVILLE NO. 137 |2 |MO
-63.64584910000001| 44.6523355|Halifax Freemasons Hall|ST. ANDREWS NO. 1 |1 |TU except July and August | 7:30pm
-63.64584910000001| 44.6523355|Halifax Freemasons Hall|ST/ ST. JOHNS NO. 2  |1 |MO 2nd |MO in September |WINTER | 7:30pm
-63.64584910000001| 44.6523355|Halifax Freemasons Hall|ST/ VIRGIN NO. 3 |4 |MO |WINTER. December's Meeting held on Boxing Day at 11 am | 7:30pm
-63.64584910000001| 44.6523355|Halifax Freemasons Hall|ST/ ROYAL SUSSEX NO. 6 |1 |TH |WINTER | 7:00pm
-63.64584910000001| 44.6523355|Halifax Freemasons Hall|ST/ KEITH NO. 17 |2 |TH |WINTER | 7:30pm
-63.64584910000001| 44.6523355|Halifax Freemasons Hall|ST/ EQUITY NO. 106 |3 |MO |WINTER | 7:30pm
-63.64584910000001| 44.6523355|Halifax Freemasons Hall|ST/ FAIRVIEW DAYLIGHT LODGE NO. 126 |3 |WE March through December Fellowship & Refreshments 12:15 to 12:50 p.m.| Lodge Called to Order. 1:00 p.m 
-63.64584910000001| 44.6523355|Halifax Freemasons Hall|ST/ AD ASTRA NO. 130  |3 |WE each month |WINTER | 7:30pm ||
-63.6462466| 44.6520683|Grand Lodge AF & AM of Nova Scotia Office|
-63.58734519999999| 44.5854977|Spryfield Masonic Hall |DUKE OF KENT NO. 121 |2 |MO of each month except June
-64.83749999999999| 45.03025|Aylesford Masonic Lodge|HARMONY NO. 52 |1 |TU | 7:30pm
-64.49681439999999| 45.0776572|Kentville Masonic Hall|KENTVILLE NO. 58 |2 |MO October meeting is held on the 2nd |TU due to Thanksgiving. Closed July and August | 7:30pm 
-64.7365509| 45.0413741|Berwick Masonic Hall|MARKLAND NO. 99 |4 |MO | 7:30pm
-64.3587141| 45.0890196|Wolfville Masonic Temple|ST GEORGES NO. 20 |3 |MO | 7:30pm
-65.5171452| 44.74471499999999|Annapolis Royal Masonic Temple|ANNAPOLIS ROYAL NO. 33 |1 |WE |SUMMER | 7:30pm
-65.7540635| 44.691115|Bridgetown Masonic Hall|EVANGELINE NO. 94 |2 |MO | 7:30pm
-66.3192497| 44.27830679999999|Freeport Community Hall|FREEPORT NO. 65 |3 |TH | 8:00pm
-65.06467719999999| 44.94306690000001|Middleton Masonic Temple|IONIC NO. 73 1st |TU in December - dark July | 7:30pm
-65.7593333| 44.6194524|Digby Masonic Hall |KING SOLOMON NO. 54 |1 |TU of every month | 7:00pm
-65.6357027| 44.5708942|Bear River Masonic Hall|THE KEITH NO. 16 |1 |MO |SUMMER | 7:30pm
-66.1528859| 44.1905308|Weymouth Historical Society Building|TUSCAN NO. 111 |2 |TU meets during the summer and is usually in darkness January & February | 7:30pm
-65.3228402| 43.7626736|Shelburne Masonic Hall|ALBERT NO. 30 |2 |WE |WINTER | 7:30pm
-66.0906701| 43.8865503|Yarmouth Masonic Temple |Hiram No.12 |2 |TH |WINTER | 7:30pm
-65.6071402| 43.5335997|Barrington Passage Masonic Hall|PHILADELPHIA NO. 47 |1 |TU | 7:30pm
-65.1140866| 43.6998663|Lockeport Masonic Hall|TAYLOR NO. 62 |4 |TU except July/ August & 3rd |TU in December| 7:30pm||
-64.5227113| 44.3753658|Bridgewater Masonic Hall |ACACIA NO. 39 |2 |TU |WINTER | 7:00pm UNITY NO. 4 |1 |TU |WINTER | 7:00pm
-64.240415| 44.54019479999999|Chester Masonic Hall|CLARKE NO. 61 |2 |TH |WINTER | 7:00pm
-64.7125217| 44.5417096|HILLCREST NO. 93|HILLCREST NO. 93  |1 |TH |WINTER
-64.4564777| 44.7391336|New Ross Masonic Hall|NORWOOD NO. 135 meets |3 |FR | 7:30pm
-64.75610999999999| 44.05924999999999|Milton Masonic Hall|PRINCE OF WALES NO. 29 |2 |TU| 7:00pm||
-64.7173641| 44.0378863|MIlton Masonic Hall|ZETLAND NO. 9 |4 |TH except July and August and |3 |WE in December | 7:30pm
-61.987512| 45.6187913|St. Pauls' United Church Hall|Sunrise Lodge No. 116 meets the 3rd |TH of the Month at 7:30pm

79
modules/foobar Normal file
View File

@ -0,0 +1,79 @@
-64.215226|45.833733| Amherst Masonic Temple| ACACIA NO. 8 |1 |TH |9,10,11,12,1,2,3,4,5,6| 7:30pm|||
-64.215226|45.833733| Amherst Masonic Temple| ALEXANDRA NO. 87 |2 |TH |9,10,11,12,1,2,3,4,5,6||| 7:30pm
-64.377925|45.691660| River Hebert Masonic Temple| |2 |TU |9,10,11,12,1,2,3,4,5,6| 7:30pm||
-63.903050|45.674388| River Philip Masonic Hall| WIDOWS SON NO. 48 |3 |TU |9,10,11,12,1,2,3,4,5,6 | 7:30pm ||
-63.903050|45.674388| River Philip Masonic Hall| LAURIE NO. 70 |3 |MO |9,10,11,12,1,2,3,4,5,6| 7:30pm |||
-63.903050|45.674388| River Philip Masonic Hall|  WIMBURN NO. 75 |3 |WE |9,10,11,12,1,2,3,4,5,6 | 8:00pm||
-63.474631|45.813670| Wallace Masonic Hall| WALLACE NO. 76 |2 |MO |3,4,5,6,7,8,9,10,11,12 | 7:30pm||
-64.326978|45.403488| Parrsboro Masonic Temple | MINAS NO. 67 |3 |MO |9,10,11,12,1,2,3,4,5,6 | 7:30pm||
-63.255786|45.377014| Tru-Fel Masonic Building| TRURO NO. 43 |1 |MO |9,10,11,12,1,2,3,4,5,6 1st |TU of September| 7:30pm |
-63.255786|45.377014| Tru-Fel Masonic Building| CORINTHIAN NO. 63 |2 |TU |9,10,11,12,1,2,3,4,5,6||| 7:30pm
-63.255786|45.377014| Tru-Fel Masonic Building| FELLOWSHIP NO. 112 |4 |TU |9,10,11,12,1,2,3,4,5,6 | 7:30pm ||
-62.997815|45.218044| Upper Stewiacke Masonic Hall| ELM NO. 115 |3 |TU |3,4,5,6,7,8,9,10,11,12 | 7:30pm||
-63.604770|45.476194| Londonderry Masonic Hall| NORTH STAR NO. 74 |1 |TH |9,10,11,12,1,2,3,4,5,6| 7:30pm|||
-62.632963|45.595603| New Glasgow Masonic Temple| ALBION NO. 5 |2 |WE |9,10,11,12,1,2,3,4,5,6| 7:30pm|||
-62.546470|45.564732| IOOF Hall| HUDSON NO. 77 |4 |TH |9,10,11,12,1,2,3,4,5,6 | 7:30pm||
-62.659794|45.558849| Stellarton Masonic Hall| KEITH NO. 23 |1 |MO |9,10,11,12,1,2,3,4,5,6 | 7:30pm||
-62.719971|45.552417| Westville Masonic Hall| NEW CALEDONIA NO. 11 |4 |MO |9,10,11,12,1,2,3,4,5,6| 7:30pm |||
-62.719971|45.552417| Westville Masonic Hall| / WESTERN STAR NO. 50 |2 |TU |9,10,11,12,1,2,3,4,5,6 | 7:30pm||
-61.499713|45.390585| Guysborough Masonic Temple| EASTERN LIGHT NO. 72 |2 |WE |9,10,11,12,1,2,3,4,5,6| 7:30pm|||
-61.984270|45.140922| Sherbrooke Masonic Hall| QUEENS NO. 34 |1 |TU |9,10,11,12,1,2,3,4,5,6| 7:30pm|||
-61.655488|45.174613| Isaacs Harbour Masonic Hall | STORMONT NO. 96  |1 |FR |9,10,11,12,1,2,3,4,5,6| 7:30pm|||
-60.362730|45.719330| Framboise Community Hall| HEATHER NO. 124 |1 |TU |9,10,11,12,1,2,3,4,5,6| 7:00pm|||
-61.119726|45.973839| Whycocomagh Masonic Hall| SIRCOM NO. 66 |1 |TH |9,10,11,12,1,2,3,4,5,6| 8:00pm|||
-61.360934|45.612700|Port Hawkesbury Masonic Temple| SOLOMON NO. 46 |3 |TU |9,10,11,12,1,2,3,4,5,6| 7:30pm|||
-60.752469|46.101559| Baddeck Masonic Hall| ST MARKS NO. 35 |3 |TH |9,10,11,12,1,2,3,4,5,6 | 7:00pm||
-60.261111|46.208527| North Sydney Masonic Hall| ROYAL OAK NO. 85 |1 |FR |3,4,5,6,7,8,9,10,11,12 | 7:30pm||
-60.196189|46.140408| Sydney Masonic Building| SYDNEY NO. 84 |1 |MO |9,10,11,12,1,2,3,4,5,6| 7:30pm |||
-60.196189|46.140408| Sydney Masonic Building| /  EAST GATE NO. 127 |4 |TH |9,10,11,12,1,2,3,4,5,6| 7:30pm |||
-59.956070|46.195870| Glace Bay Masonic Hall| THE TYRIAN YOUTH NO. 45 |4 |TU |9,10,11,12,1,2,3,4,5,6 |3 |TH in December | 7:30pm|
-59.972940|45.919942| Louisbourg United Church Hall| MARINERS NO. 80  |2 |WE |9,10,11,12,1,2,3,4,5,6 | 7:30pm||
-60.261111|46.208527|North Sydney Masonic Building | ROYAL ALBERT NO. 19  |3 |MO |9,10,11,12,1,2,3,4,5,6 | 7:30pm||
-59.871211|46.135428| Port Morien Masonic Hall| THE THISTLE NO. 36 |1 |WE |9,10,11,12,1,2,3,4,5,6 | 7:30pm||
-63.836830|44.899300| Mount Uniacke Masonic Hall| UNIACKE NO. 128 |2 |TU |9,10,11,12,1,2,3,4,5,6| 7:30pm|||
-63.505741|44.969750| Elmsdale Masonic Hall| C.W. SAUNDERS NO. 125 |3 |WE |9,10,11,12,1,2,3,4,5,6 | 7:30pm||
-64.193549|45.071758| Hants Border Community Hall| POYNTZ LODGE NO. 44 |1 |TH |9,10,11,12,1,2,3,4,5,6| 7:30pm|||
-64.098874|44.964107| Three Mile Plains Commty Hall| |0 | 7:30pm |||||
-63.493045|45.316558| Maitland Masonic Hall| W.D. LAWRENCE NO. 101  |2 |MO |9,10,11,12,3,4,5,6,7,8| 7:30pm|||
-64.120304|44.990262| Windsor Masonic Temple| |0 |||||
-63.102602|44.784709| Ashlar Masonic Hall| ASHLAR NO. 107 |1 |TU |9,10,11,12,1,2,3,4,5,6 | 8:00pm||
-63.655287|44.730426| Bedford Masonic Hall| BEDFORD NO. 104 |3 |MO |9,10,11,12,1,2,3,4,5,6 | 7:00pm ||
-63.655287|44.730426| Bedford Masonic Hall| BEDFORD/ JOHN ALBRO NO. 122 |4 |TH |9,10,11,12,1,2,3,4,5,6| 7:30pm||
-63.655287|44.730426| Bedford Masonic Hall| BEDFORD/ CORNWALLIS NO. 95 |3 |TU |9,10,11,12,1,2,3,4,5,6| 7:30pm |||
-63.655287|44.730426| Bedford Masonic Hall| BEDFORD/ WENTWORTH NO. 108 |3 |TH |9,10,11,1,2,3,4,5,6,7,8| |1 |TH | 7:00pm |
-63.655287|44.730426| Bedford Masonic Hall| BEDFORD/ WOODLAWN NO. 131 |2 |TH |9,10,11,12,1,2,3,4,5,6 | 7:30pm||
-63.655287|44.730426| Bedford Masonic Hall| LODGE LA FRANCE NO. 138|4 |FR |3,5,6|||
-62.520556|44.920502| Sheet Harbour Masonic Hall| EUREKA NO. 42 |4 |WE |9,10,11,12,3,4,5,6,7,8|| 7:30pm|||
-63.694179|44.781549| Sackville Masonic Temple| SACKVILLE NO. 137 |2 |MO |9,10,11,12,1,2,3,4,5,6|19.00|||
-63.645849|44.652335| Halifax Freemasons Hall| ST. ANDREWS NO. 1 |1 |TU |9,10,11,12,1,2,3,4,5,6|| 7:30pm |||
-63.645849|44.652335| Halifax Freemasons Hall| ST/ ST. JOHNS NO. 2  |1 |MO 2nd |MO in September |9,10,11,12,1,2,3,4,5,6 | 7:30pm |
-63.645849|44.652335| Halifax Freemasons Hall| ST/ VIRGIN NO. 3 |4 |MO |9,10,11,12,1,2,3,4,5,6. December's Meeting held on Boxing Day at 11 am | 7:30pm ||
-63.645849|44.652335| Halifax Freemasons Hall| ST/ ROYAL SUSSEX NO. 6 |1 |TH |9,10,11,12,1,2,3,4,5,6 | 7:00pm ||
-63.645849|44.652335| Halifax Freemasons Hall| ST/ KEITH NO. 17 |2 |TH |9,10,11,12,1,2,3,4,5,6 | 7:30pm ||
-63.645849|44.652335| Halifax Freemasons Hall| ST/ EQUITY NO. 106 |3 |MO |9,10,11,12,1,2,3,4,5,6 | 7:30pm ||
-63.645849|44.652335| Halifax Freemasons Hall| FAIRVIEW DAYLT LODGE NO. 126 |3 |3,4,5,6,7,8,9,10,11,12| Fellowship & Refreshments 12:15 to 12:50 p.m.| Lodge Called to Order. 1:00 p.m  |||
-63.645849|44.652335| Halifax Freemasons Hall|  AD ASTRA NO. 130  |3 |WE |each month |9,10,11,12,1,2,3,4,5,6 | 7:30pm ||
-63.646247|44.652068| Grand Lodge Office| ||||||
-63.587345|44.585498| Spryfield Masonic Hall | DUKE OF KENT NO. 121 |2 |MO |7,8,9,10,11,12,1,2,3,4,5||||
-64.837500|45.030250| Aylesford Masonic Lodge| HARMONY NO. 52 |1 |TU | 7:30pm|||
-64.496814|45.077657| Kentville Masonic Hall| KENTVILLE NO. 58 |2 |MO |October meeting is held on the 2nd |TU due to Thanksgiving. Closed July and August | 7:30pm ||
-64.736551|45.041374| Berwick Masonic Hall| MARKLAND NO. 99 |4 |MO | 7:30pm|||
-64.358714|45.089020| Wolfville Masonic Temple| ST GEORGES NO. 20 |3 |MO | 7:30pm|||
-65.517145|44.744715|Annapolis Royal Masonic Temple| ANNAPOLIS ROYAL NO. 33 |1 |WE |3,4,5,6,7,8,9,10,11,12 | 7:30pm||
-65.754064|44.691115| Bridgetown Masonic Hall| EVANGELINE NO. 94 |2 |MO | 7:30pm|||
-66.319250|44.278307| Freeport Community Hall| FREEPORT NO. 65 |3 |TH | 8:00pm|||
-65.064677|44.943067| Middleton Masonic Temple| IONIC NO. 73 |1 |TU | 7:30pm||||
-65.759333|44.619452| Digby Masonic Hall | KING SOLOMON NO. 54 |1 |TU |of every month | 7:00pm|||
-65.635703|44.570894| Bear River Masonic Hall| THE KEITH NO. 16 |1 |MO |3,4,5,6,7,8,9,10,11,12 | 7:30pm||
-66.152886|44.190531| Weymouth Hist Soc Building| TUSCAN NO. 111 |2 |TU |meets during the 3,4,5,6,7,8,9,10,11,12 and is usually in darkness January & February | 7:30pm|||
-65.322840|43.762674| Shelburne Masonic Hall| ALBERT NO. 30 |2 |WE |9,10,11,12,1,2,3,4,5,6 | 7:30pm||
-66.090670|43.886550| Yarmouth Masonic Temple | Hiram No.12 |2 |TH |9,10,11,12,1,2,3,4,5,6 | 7:30pm||
-65.607140|43.533600|Barrington Passge Masonic Hall| PHILADELPHIA NO. 47 |1 |TU | 7:30pm|||
-65.114087|43.699866| Lockeport Masonic Hall| TAYLOR NO. 62 |4 |TU |9,10,11,12,1,2,3,4,5,6| |TU in December| 7:30pm||
-64.522711|44.375366| Bridgewater Masonic Hall | ACACIA NO. 39 |2 |TU |9,10,11,12,1,2,3,4,5,6 | 7:00pm UNITY NO. 4 |1 |TU
-64.240415|44.540195| Chester Masonic Hall| CLARKE NO. 61 |2 |TH |9,10,11,12,1,2,3,4,5,6 | 7:00pm||
-64.712522|44.541710| HILLCREST NO. 93| HILLCREST NO. 93  |1 |TH |9,10,11,12,1,2,3,4,5,6|||
-64.456478|44.739134| New Ross Masonic Hall| NORWOOD NO. 135 meets |3 |FR |9,10,11,12,1,2,3,4,5,6| 7:30pm|||
-64.756110|44.059250| Milton Masonic Hall| PRINCE OF WALES NO. 29 |2 |TU |9,10,11,12,1,2,3,4,5,6| 7:00pm|||
-64.717364|44.037886| MIlton Masonic Hall| ZETLAND NO. 9 |4 |TH | except July and August and |3 |WE in December | 7:30pm|
-61.987512|45.618791| St. Pauls' United Church Hall| Sunrise Lodge No. 116 |3 |TH |9,10,11,12,1,2,3,4,5,6|7:30pm|||||

1
modules/intox Submodule

@ -0,0 +1 @@
Subproject commit 1c025fb8ad19ac9fb101b2e2da2966a54e8cb67d

View File

@ -37,6 +37,9 @@ class Camera(object):
CAM = None CAM = None
frame = None frame = None
def init(self):
print("NOOP")
def acquire(self, strcam, filename, test=False): def acquire(self, strcam, filename, test=False):
MAX = 20 MAX = 20
cam = int(strcam) cam = int(strcam)