{"id":207,"date":"2019-06-20T17:26:08","date_gmt":"2019-06-20T17:26:08","guid":{"rendered":"https:\/\/delphijustin.biz\/?p=207"},"modified":"2021-10-13T20:25:17","modified_gmt":"2021-10-14T01:25:17","slug":"lightnix-serial-port-light-flasher","status":"publish","type":"post","link":"https:\/\/delphijustin.biz\/lightnix-serial-port-light-flasher\/","title":{"rendered":"Lightnix Serial Port Light Flasher"},"content":{"rendered":"\n<p class=\"MsoNormal\">Lightnix is a open source serial\/parallel port holiday\nflasher driver for windows. You can see its full capability by opening <u>winlight.exe<\/u>\nat the command prompt. <\/p>\n\n<h1>Examples<\/h1>\n\n<h2>Flashing lights from serial port com1<\/h2>\n\n<p class=\"MsoNormal\">Winlight.exe flash=<span style=\"color:#0070C0\">100 <\/span>com=<span style=\"color:#92D050\">\\\\.\\COM1<\/span><\/p>\n\n<p class=\"MsoNormal\">The number in blue is the slowness speed of the flash in milliseconds\nand \\\\.\\com1 is the com port path. This way can only flash up to 2 strains of\nlights at once.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">program winlight;\n{$APPTYPE CONSOLE}\n{$RESOURCE Lightnix.res}\nuses\n  SysUtils,\n  windows,\n  Classes;\nconst DRVF_USERDEF_MASK=1;\n\ntype\nTDriverInfo=record\ncbSize,Flags,mask:integer;\nCurrentBuildDate,RequiredBuildDate:TSYSTEMTIME;\netc,errormsg:ShortString;\nend;\nTOut32=procedure(io:word;x:byte);stdcall;\nTInp32=function(io:word):byte;stdcall;\nTDriverInit=function(var drvinfo:tdriverinfo):integer;stdcall;\nTDriverInp=function(xdefault:integer):integer;stdcall;\nTDriverOut=function(x:integer):integer;stdcall;\nvar x,y,i:integer;\nparams:tstringlist;\nio:word;\ndinfo:TDriverInfo;\nOut32:tout32;\nInp32:tinp32;\ninpout32,drv:hmodule;\ndriverinit:tdriverinit;\ndriverinp:tdriverinp;\ndriverout:tdriverout;\nhapp,com:thandle;\nurl:string;\nverinfo:_BY_HANDLE_FILE_INFORMATION;\nlabel loop1,loop2;\nbegin\ndinfo.cbSize:=sizeof(dinfo);\nhapp:=createfile(PChar(paramstr(0)),generic_read,file_share_read,nil,open_existing,\nfile_attribute_normal,0);\ngetfileinformationbyhandle(happ,verinfo);\nclosehandle(happ);\nfiletimetosystemtime(verinfo.ftLastWriteTime,dinfo.currentbuilddate);\nwriteln('Lightnix32 build ',dinfo.currentbuilddate.wMonth,'\/',\ndinfo.currentbuilddate.wDay,'\/',dinfo.currentbuilddate.wYear);\nif paramcount = 0 then begin\nwriteln('Usage: WINLIGHT [option=value]');\nwriteln('I\/O Options:');\nwriteln('IOAddr     Specifies the I\/O address to use');\nwriteln('OUT        Specifies what value to set the I\/O Address');\nwriteln('WAIT       Specifies the number of seconds to wait,before the address reverts back');\nWriteln('FLASH      Enter flash mode, its value is a delay in miliseconds');\nwriteln('MASK       Defines the maximum value that it will oscilate to, use with FLASH');\nwriteln('');\nwriteln('Serial Options:');\nwriteln('COM        Specifies the COM Port to use. Example COM=\\\\.\\COM1');\nwriteln('MCR        Specifies what to set the Modem Control Register D for Data Terminal Ready and R for Request To Send');\nwriteln('WAIT       Same as above but for serial ports');\nwriteln('FLASH      Same as above but for serial ports');\nwriteln('');\nwriteln('Plugin Options:');\nwriteln('DRIVER     Defines the driver DLL file');\nwriteln('ETC        Defines extra settings for the driver');\nwriteln('WAIT       Same as above but for driver');\nwriteln('OUT        Same as above but for driver');\nwriteln('OUT2       Used only when WAIT is used, its the reverting value');\nwriteln('FLASH      Same as above but for driver');\nwriteln('MASK       Same as above but for driver');\nexit;\nend;\nparams:=tstringlist.create;\nfor i:= 1 to paramcount do\nparams.Add(paramstr(i));\nif params.Values['DRIVER']&lt;>'' then begin\ndinfo.CurrentBuildDate.wDayOfWeek:=0;\ncopymemory(@dinfo.requiredbuilddate,@dinfo.currentbuilddate,sizeof(tsystemtime));\ndrv:=loadlibrary(pchar(params.values['driver']));\nif drv=0 then begin writeln(Syserrormessage(getlasterror));exit;end;\n@DriverInit:=GetProcAddress(drv,'DriverInit');\n@DriverInp:=GetProcAddress(drv,'DriverInp');\n@DriverOut:=GetProcAddress(drv,'DriverOut');\nif (@driverinit=nil)or(@driverinp=nil)or(@driverout=nil) then begin\nwriteln('Some functions couldnt load');\nexitprocess(error_bad_driver);\nend;\ndinfo.mask:=strtointdef(params.values['Mask'],255);\ndinfo.etc:=params.Values['etc'];\ni:=driverinit(dinfo);\nif encodedate(dinfo.currentbuilddate.wYear,dinfo.currentbuilddate.wMonth,\ndinfo.currentbuilddate.wDay)&lt;encodedate(dinfo.requiredbuilddate.wyear,\ndinfo.requiredbuilddate.wMonth,dinfo.requiredbuilddate.wDay) then begin\nwriteln('This driver requires a newer build in order to run.');\nexitprocess(error_bad_device);\nend;\nif (i&lt;>0) or (dinfo.errormsg&lt;>'') then begin\nif dinfo.errormsg='' then begin\nwriteln('DriverInit:',syserrormessage(i));\nexitprocess(i);\nend else begin writeln('DriverInit:',dinfo.errormsg);\nexitprocess(error_bad_driver);\nend;\nend;\nif params.Values['wait']&lt;>''then begin\nwriteln('Requesting for starting value...');\nx:=DriverInp(strtointdef(params.values['out2'],0));\nif x&lt;-1 then begin writeln('Driver failed!');exitprocess(error_bad_driver);end;\nif x=-1 then writeln('There is no starting value') else\nwriteln('Starting value is $',IntToHex(x,0));\ndriverout(strtointdef(params.values['out'],0));\nsleep(1000*strtointdef(params.values['wait'],1));\ndriverout(x);\nend;\nend else\nif params.Values['IOAddr']&lt;>'' then\nbegin\ninpout32:=LoadLibrary('inpout32.dll');\n@out32:=getprocaddress(inpout32,'Out32');\n@inp32:=Getprocaddress(inpout32,'Inp32');\nio:= strtointdef(params.values['IOAddr'],$378);\nx:=inp32(io);\nwriteln('Starting value for $'+inttohex(io,0)+' is $'+inttohex(x,2));\nif strtointdef(Params.values['Wait'],0)>0 then begin\ny:=strtointdef(params.values['out'],$ff);\nwriteln('Outputing $'+inttohex(y,2));\nout32(io,y);\nsleep(1000*strtointdef(params.Values['wait'],1));\nwriteln('Reverting back');\nout32(io,x);\nexitprocess(0);\nend;\nif params.Values['Flash']&lt;>'' then begin\nwrite('Sending pulses');\nloop1:\nfor x:= 0 to StrTointDef(params.values['Mask'],255) do\nbegin\nout32(io,x);\nwrite('.');\nsleep(strtointdef(params.values['flash'],100));\nend;\ngoto loop1;\nend else begin\n writeln('Sending Byte');\n Out32(io,StrToIntDef(params.values['out'],0));\nend;\nend else if params.Values['COM']&lt;>'' then begin\ncom:=createfile(@params.values['com'][1],generic_read,0,nil,open_existing,\nfile_attribute_normal,0);\nif com=INVALID_HANDLE_VALUE then begin\nwriteln(Syserrormessage(getlasterror));\nexitprocess(getlasterror);\nend;\nif not escapecommfunction(com,clrdtr) then begin\nwriteln(syserrormessage(getlasterror));\nclosehandle(com);\nexitprocess(getlasterror);\nend;\nif Params.Values['WAIT']&lt;>'' then begin\nwriteln('Waiting...');\nsleep(1000*strtointdef(params.values['wait'],1));\nif pos('D',params.values['MCR'])>0 then escapecommfunction(com,setdtr);\nif pos('R',params.values['MCR'])>0 then escapecommfunction(com,setrts);\nend;\nif params.Values['Flash']&lt;>'' then begin\nwrite('Sending Pulses');\nloop2:\nEscapeCommfunction(com,clrdtr);\nEscapeCommFunction(com,clrrts);\nwrite('.');\nsleep(strtointdef(Params.values['flash'],100));\nEscapeCommfunction(com,setdtr);\nEscapeCommFunction(com,clrrts);\nwrite('.');\nsleep(strtointdef(Params.values['flash'],100));\nEscapeCommfunction(com,clrdtr);\nEscapeCommFunction(com,setrts);\nwrite('.');\nsleep(strtointdef(Params.values['flash'],100));\nEscapeCommfunction(com,setdtr);\nEscapeCommFunction(com,setrts);\nwrite('.');\nsleep(strtointdef(Params.values['flash'],100));\ngoto loop2;\nend;\nclosehandle(com);\nend else writeln('Cannot tell what to use, perhaps you forgot an option.');\nend.\n<\/pre>\n\n\n\n<input type=\"hidden\" name=\"_fmakey\" id=\"fmakey\" value=\"103e4fd117\"><div id=\"file_manager_advanced\"><\/div>\r\n<p><center>All programs are virus free. Some antivirus software might say its \"suspicious\" or a \"Potentionaly Unwanted Program\". Some of them rate them on what there code looks like no matter if theres a definition in the virus database. If any of them are detected any Antivirus I will zip the software with the password \"justin\" j is lowercase<\/center><br><iframe src=\"\/wp-content\/downloads\/gethashes.php?app=winlight\" height=\"255px\" width=\"100%\">\r\n\t<form action=\"\/wp-content\/downloads\/gethashes.php\" method=\"get\" target=\"apphashes\">\r\n\t\t<input type=\"hidden\" name=\"app\" value=\"winlight\">\r\n\t\t<input type=\"submit\" value=\"Get File Hashes\">\r\n\t<\/form>\r\n\t\t<\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Lightnix is a open source serial\/parallel port holiday flasher driver for windows. You can see its full capability by opening winlight.exe at the command prompt. Examples Flashing lights from serial port com1 Winlight.exe flash=100 com=\\\\.\\COM1 The number in blue is the slowness speed of the flash in milliseconds and \\\\.\\com1 is the com port path. &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/delphijustin.biz\/lightnix-serial-port-light-flasher\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Lightnix Serial Port Light Flasher&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"beyondwords_generate_audio":"","beyondwords_project_id":"","beyondwords_content_id":"","beyondwords_preview_token":"","beyondwords_player_style":"","beyondwords_language_id":"","beyondwords_title_voice_id":"","beyondwords_body_voice_id":"","beyondwords_summary_voice_id":"","beyondwords_error_message":"","beyondwords_disabled":"","beyondwords_delete_content":"","beyondwords_podcast_id":"","beyondwords_hash":"","publish_post_to_speechkit":"","speechkit_hash":"","speechkit_generate_audio":"","speechkit_project_id":"","speechkit_podcast_id":"","speechkit_error_message":"","speechkit_disabled":"","speechkit_access_key":"","speechkit_error":"","speechkit_info":"","speechkit_response":"","speechkit_retries":"","speechkit_status":"","speechkit_updated_at":"","_speechkit_link":"","_speechkit_text":""},"categories":[4],"tags":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/delphijustin.biz\/wp-json\/wp\/v2\/posts\/207"}],"collection":[{"href":"https:\/\/delphijustin.biz\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/delphijustin.biz\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/delphijustin.biz\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/delphijustin.biz\/wp-json\/wp\/v2\/comments?post=207"}],"version-history":[{"count":4,"href":"https:\/\/delphijustin.biz\/wp-json\/wp\/v2\/posts\/207\/revisions"}],"predecessor-version":[{"id":4010,"href":"https:\/\/delphijustin.biz\/wp-json\/wp\/v2\/posts\/207\/revisions\/4010"}],"wp:attachment":[{"href":"https:\/\/delphijustin.biz\/wp-json\/wp\/v2\/media?parent=207"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/delphijustin.biz\/wp-json\/wp\/v2\/categories?post=207"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/delphijustin.biz\/wp-json\/wp\/v2\/tags?post=207"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}