Skip to content

Commit

Permalink
Added new module to auto-connect two logics on startup, or baisclly s…
Browse files Browse the repository at this point in the history
…end any command at startup after a logic has finished starting up
  • Loading branch information
guysoft committed Oct 8, 2012
1 parent 658fccf commit 5a16ccf
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
4 changes: 4 additions & 0 deletions config.ini.example
Expand Up @@ -21,3 +21,7 @@ STATIONS={"4Z7GAI-R": "624651"}
[modules.EcholinkLoggerModule]
#Set this to where your sqlite databse is located
DATABASE_PATH=/var/ham/EcholinkQsoLog.sqlite

[modules.AutoLinkLogics]
CONNECT_COMMAND=941#
SECOND_LOGIC=RepeaterLogic
31 changes: 31 additions & 0 deletions src/modules/AutoLinkLogics.py
@@ -0,0 +1,31 @@
#!/usr/bin/env python
''' SvxLinkWrapper - wrapper for SvxLink
Module to auto-connect Two logics together
Created on Feb 1, 2012
@author: Guy Sheffer <guysoft at gmail dot com>
'''
import SvxlinkwrapperModule
import time
import json

QSO_CALLSIGN_SEPERATOR=":"

class AutoLinkLogics(SvxlinkwrapperModule.SvxlinkwrapperModule):
''' Module to handle autoconnect to stations at startup '''
def __init__(self,SvxLink):
#Init
SvxlinkwrapperModule.SvxlinkwrapperModule.__init__(self, SvxLink)
self.CONNECT_COMMAND=self.getConfigVar("CONNECT_COMMAND")
self.SECOND_LOGIC=self.getConfigVar("SECOND_LOGIC")
return

def handleStdout(self,line):
'''
Every stdout message would call this function
'''

if line.startswith("Starting logic: " + self.SECOND_LOGIC):
self.SvxLink.sendToSvxLink(self.CONNECT_COMMAND)#Open echolink

return

0 comments on commit 5a16ccf

Please sign in to comment.