Esempio n. 1
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),ui(new Ui::MainWindow),options(new channelOptions(this)),modOptions(new moduleDialog(this)),serialPortOpt(new serialPortOptions(this)),thePlaylist(new playlist(this))//thePlayer(new QMediaPlayer),
{
    thePlayer = NULL;
    ui->setupUi(this);
    playbackRate=1;
    serialPortName="COM3";
    //serialPortName="/dev/ttyUSB0";
    //thePort.setPortName("/dev/ttyACM0");
    thePort.setPortName(serialPortName);
    thePort.setBaudRate(QSerialPort::Baud9600);
    serialOutputOn=0;
    connect(ui->label_2,SIGNAL(playScroll(int)),ui->horizontalScrollBar,SLOT(setValue(int)));
    connect(ui->label_2,SIGNAL(trackSelected(uint,QColor)),this,SLOT(channelSelected(uint,QColor)));
    connect(ui->label_2,SIGNAL(updatePicture(binaryTrack)),ui->label,SLOT(whatToLightUp(binaryTrack)));
    connect(ui->label_2,SIGNAL(updatePicture(binaryTrack)),this,SLOT(writeToSerialPort(binaryTrack)));
    connect(ui->actionExit,SIGNAL(triggered()),this,SLOT(close()));
    connect(options,SIGNAL(removeChannel(int)),this,SLOT(removeChannel(int)));
    connect(options,SIGNAL(theColorChanged(uint,QColor)),this,SLOT(channelColorHasChanged(uint,QColor)));
    connect(options,SIGNAL(changeEditMode(bool)),ui->label,SLOT(changeEditMode(bool)));
    connect(options,SIGNAL(channelEnableButtonPushed(int,bool)),this,SLOT(channelEnabledButtonPushed(int,bool)));
    connect(serialPortOpt,SIGNAL(setNewSerialPort(QString)),this,SLOT(serialPortNameChanged(QString)));
    connect(thePlaylist,SIGNAL(changeSong(QString)),this,SLOT(playlistChangeSong(QString)));
    tempTrackCount=0;
}
Esempio n. 2
0
void CdWidget::previous()
{
	if ( !channelsLb->count() )
		return;
	if ( (lastChannel-1)<1 )
		return;
	lastChannel--;
	channelSelected( channelsLb->text( lastChannel-1 ) );
}
Esempio n. 3
0
void CdWidget::next()
{
	if ( !channelsLb->count() )
		return;
	if ( (lastChannel+1)>(int)channelsLb->count() )
		return;
	lastChannel++;
	channelSelected( channelsLb->text( lastChannel-1 ) );
}
Esempio n. 4
0
void CdWidget::playLastChannel()
{
	if ( !channelsLb->count() )
		return;
	if ( !lastChannel ) {
		lastChannel++;
	}
	else if ( lastChannel>(int)channelsLb->count() ) {
		lastChannel = 1;
	}
	channelSelected( channelsLb->text( lastChannel-1 ) );
}
Esempio n. 5
0
void scanControl(vmacApInfo_t *vmacSta_p)
{
#ifdef MRVL_DFS
	if((!channelSelected(vmacSta_p,*(vmacSta_p->Mib802dot11->mib_ApMode) >=AP_MODE_A_ONLY))
       && !vmacSta_p->dfsCacExp)
#else
	if(!channelSelected(vmacSta_p,*(vmacSta_p->Mib802dot11->mib_ApMode) >=AP_MODE_A_ONLY))
#endif
	{
		if(SetupScan(vmacSta_p))
			return;
	}
	else
	{
		PrepareNextScan(vmacSta_p);
	}
#ifdef MRVL_DFS
    vmacSta_p->dfsCacExp = 0;
#endif
	extStaDb_ProcessKeepAliveTimerInit(vmacSta_p);
	MonitorTimerInit(vmacSta_p);
}
IRCAddContactPage::IRCAddContactPage( QWidget *parent, IRCAccount *a )
	: AddContactPage(parent), Ui::ircAddUI(), d(new Private)
{
	setupUi(this);

// 	d->search = new ChannelList( hbox, a->client() );
// 	QVBoxLayout *layout = new QVBoxLayout( hbox );
// 	hbox->setLayout(layout);
// 	layout->addWidget(d->search);

	d->account = a;

	connect( d->search, SIGNAL(channelSelected(QString)),
		this, SLOT(slotChannelSelected(QString)) );

	connect( d->search, SIGNAL(channelDoubleClicked(QString)),
		this, SLOT(slotChannelDoubleClicked(QString)) );
}
Esempio n. 7
0
void StopAutoChannel(vmacApInfo_t *vmacSta_p)
{
	UINT8 cur_channel;
	UINT8 *mib_autochannel_p = vmacSta_p->ShadowMib802dot11->mib_autochannel;

	vmacSta_p->busyScanning = 0;
	if(*mib_autochannel_p)
	{
		vmacSta_p->autochannelstarted = 1;
		cur_channel = channelSelected(vmacSta_p,*(vmacSta_p->Mib802dot11->mib_ApMode) >=AP_MODE_A_ONLY);
		wlUpdateAutoChan(vmacSta_p,cur_channel,0);

		DisableBlockTrafficMode(vmacSta_p);
	}

	Disable_ScanTimerProcess(vmacSta_p);

	return;
}
Esempio n. 8
0
void CdWidget::playNumChannel( int num )
{
	if ( num>0 && num<=(int)channelsLb->count() )
		channelSelected( channelsLb->text( num-1 ) );
}
Esempio n. 9
0
void ChannelList::slotItemSelected( QListViewItem *i )
{
	emit channelSelected( i->text(0) );
}
Esempio n. 10
0
/******************************************************************************
*
* Name: SendStartCmd 
*
* Description:This function is called to send the Start command to MLME. Called 
* after init, and also when ever the Config param belonging to the Start command
*
* Conditions For Use:
*
* Arguments:
*   None.
*
* Return Value:
*   None.
*
* Notes:
*   None.
*
* PDL:
* END PDL
*
*****************************************************************************/
UINT32 SendStartCmd(vmacApInfo_t *vmacSta_p)
{
	MIB_802DOT11 *mib=vmacSta_p->Mib802dot11;
	MIB_STA_CFG  *mib_StaCfg_p=vmacSta_p->Mib802dot11->StationConfig;
	MIB_OP_DATA  *mib_OpData_p=vmacSta_p->Mib802dot11->OperationTable;
	MIB_PHY_DSSS_TABLE *PhyDSSSTable_p=vmacSta_p->Mib802dot11->PhyDSSSTable;
	MIB_PRIVACY_TABLE *mib_PrivacyTable_p=vmacSta_p->Mib802dot11->Privacy;
#ifdef AP_URPTR
	extern UINT8 mib_urMode;
#endif
#ifdef AP_MAC_LINUX
	macmgmtQ_SmeCmd_t SmeCmd;
#endif
	macmgmtQ_SmeCmd_t *SmeCmd_p;
	UINT32 i, j, k;
#ifdef BRS_SUPPORT
	UINT32 rateMask;
	UINT32 basicRateMask;
#endif
	/* code for sending Start Cmd */
	SmeCmd_p = &SmeCmd;
	memset(SmeCmd_p,
		0,
		sizeof(macmgmtQ_SmeCmd_t));
	SmeCmd_p->CmdType = SME_CMD_START;
	CopySsId(SmeCmd_p->Body.StartCmd.SsId, mib_StaCfg_p->DesiredSsId);
	{
		SmeCmd_p->Body.StartCmd.BssType = mib_StaCfg_p->DesiredBssType;
		SmeCmd_p->Body.StartCmd.BcnPeriod = *(mib->mib_BcnPeriod);
		SmeCmd_p->Body.StartCmd.DtimPeriod = mib_StaCfg_p->DtimPeriod;
		/* Number of beacon intervals between DTIMs */
		SmeCmd_p->Body.StartCmd.SsParamSet.CfParamSet.ElementId = CF_PARAM_SET;
		SmeCmd_p->Body.StartCmd.SsParamSet.CfParamSet.CfpCnt = 0; /* HW MAC fills later */
		SmeCmd_p->Body.StartCmd.SsParamSet.CfParamSet.CfpPeriod = mib_StaCfg_p->CfPeriod;
		SmeCmd_p->Body.StartCmd.SsParamSet.CfParamSet.CfpMaxDuration = mib_StaCfg_p->CfpMax;
		SmeCmd_p->Body.StartCmd.SsParamSet.CfParamSet.CfpDurationRemaining = 0; /* HW MAC */
		SmeCmd_p->Body.StartCmd.SsParamSet.CfParamSet.Len = sizeof(IEEEtypes_CfParamSet_t) -
			sizeof(IEEEtypes_ElementId_t) - sizeof(IEEEtypes_Len_t);

		SmeCmd_p->Body.StartCmd.PhyParamSet.DsParamSet.ElementId = DS_PARAM_SET;
		SmeCmd_p->Body.StartCmd.PhyParamSet.DsParamSet.Len = 1;
#ifdef AUTOCHANNEL
		if(PhyDSSSTable_p->CurrChan ==0 ||PhyDSSSTable_p->CurrChan2==0) // || g_urAutoCfg)
		{
			UINT8 chsel_a, chsel_g;
			chsel_a = channelSelected(vmacSta_p,1);
			chsel_g = channelSelected(vmacSta_p,0);
			if(PhyDSSSTable_p->CurrChan ==0)
			{
				if(*(mib->mib_ApMode)>=AP_MODE_A_ONLY)
				{
					SmeCmd_p->Body.StartCmd.PhyParamSet.DsParamSet.CurrentChan = chsel_a;
				}
				else
				{
					SmeCmd_p->Body.StartCmd.PhyParamSet.DsParamSet.CurrentChan = chsel_g;
				}
			}
			else
			{
				SmeCmd_p->Body.StartCmd.PhyParamSet.DsParamSet.CurrentChan = PhyDSSSTable_p->CurrChan;
			}
			RfSwitchChanA = PhyDSSSTable_p->CurrChan?PhyDSSSTable_p->CurrChan:chsel_a;
			RfSwitchChanG = PhyDSSSTable_p->CurrChan2?PhyDSSSTable_p->CurrChan2:chsel_g;
		}
		else
#endif
		{
			SmeCmd_p->Body.StartCmd.PhyParamSet.DsParamSet.CurrentChan = PhyDSSSTable_p->CurrChan;
			RfSwitchChanA=PhyDSSSTable_p->CurrChan;
			RfSwitchChanG= PhyDSSSTable_p->CurrChan2;
		}

		SmeCmd_p->Body.StartCmd.ProbeDelay = 10;
		SmeCmd_p->Body.StartCmd.CapInfo.Ess = 1;
		SmeCmd_p->Body.StartCmd.CapInfo.Ibss = 0;
		SmeCmd_p->Body.StartCmd.CapInfo.CfPollable = mib_StaCfg_p->CfPollable ? 1 : 0;
		SmeCmd_p->Body.StartCmd.CapInfo.CfPollRqst = 0;
		if (*(mib->mib_ApMode) != AP_MODE_B_ONLY &&  *(mib->mib_ApMode) !=AP_MODE_AandG)
			SmeCmd_p->Body.StartCmd.CapInfo.ShortSlotTime = *(mib->mib_shortSlotTime);
		else
			SmeCmd_p->Body.StartCmd.CapInfo.ShortSlotTime = 0;

		//	  if(mib_StaCfg_p->PrivOption == TRUE && mib_PrivacyTable_p->PrivInvoked == TRUE)
		if (mib_PrivacyTable_p->PrivInvoked)
		{
			SmeCmd_p->Body.StartCmd.CapInfo.Privacy = 1;
		}
		else
		{
			if (mib_PrivacyTable_p->RSNEnabled)
				SmeCmd_p->Body.StartCmd.CapInfo.Privacy = 1;
			else
				SmeCmd_p->Body.StartCmd.CapInfo.Privacy = 0;
		}

		if (mib_StaCfg_p->mib_preAmble == PREAMBLE_LONG || mib_StaCfg_p->mib_preAmble == PREAMBLE_AUTO_SELECT || *(mib->mib_ApMode)==AP_MODE_A_ONLY)
		{
			SmeCmd_p->Body.StartCmd.CapInfo.ShortPreamble = 0;
		}
		else
		{
			SmeCmd_p->Body.StartCmd.CapInfo.ShortPreamble = 1;
		}


		SmeCmd_p->Body.StartCmd.CapInfo.Pbcc = 0;
		SmeCmd_p->Body.StartCmd.CapInfo.ChanAgility = 0;

#ifdef IEEE80211H
		SmeCmd_p->Body.StartCmd.CapInfo.SpectrumMgmt = mib_StaCfg_p->SpectrumManagementRequired ? 1:0;
#endif /* IEEE80211H */

		/* Form the Rate from the mib, separate the Basic and Op rate set */

#ifdef BRS_SUPPORT
		i = j = k = 0;
		rateMask = *(mib->BssBasicRateMask) | *(mib->NotBssBasicRateMask);
		basicRateMask = *(mib->BssBasicRateMask);

		while ( i < IEEEtypes_MAX_DATA_RATES_G && mib_StaCfg_p->OpRateSet[i] != '\0') {
			if (rateMask & 0x01) {

				if ( basicRateMask & 0x01) {
					SmeCmd_p->Body.StartCmd.BssBasicRateSet[j] = (mib_StaCfg_p->OpRateSet[i] & 0x7F);
					SmeCmd_p->Body.StartCmd.OpRateSet[k] = (mib_StaCfg_p->OpRateSet[i] & 0x7F);

					j++;k++;
				}
				else
				{
					SmeCmd_p->Body.StartCmd.OpRateSet[k] = (mib_StaCfg_p->OpRateSet[i] & 0x7F);
					k++;
				}
			}
			i++;
			rateMask >>= 1;
			basicRateMask >>= 1;

		}
#else
		i = j = k = 0;
		while ( i < IEEEtypes_MAX_DATA_RATES_G && mib_StaCfg_p->OpRateSet[i] != '\0') {
			if ( mib_StaCfg_p->OpRateSet[i] & 0x80) {
				SmeCmd_p->Body.StartCmd.BssBasicRateSet[j] = (mib_StaCfg_p->OpRateSet[i] & 0x7f);
				SmeCmd_p->Body.StartCmd.OpRateSet[k] = mib_StaCfg_p->OpRateSet[i] & 0x7f;
				i++;j++;k++;
			}
			else
			{
				SmeCmd_p->Body.StartCmd.OpRateSet[k] = mib_StaCfg_p->OpRateSet[i] & 0x7f;
				i++;k++;
			}


		}
#endif
		if (i < IEEEtypes_MAX_DATA_RATES_G )
		{
			SmeCmd_p->Body.StartCmd.BssBasicRateSet[j] = '\0';
			SmeCmd_p->Body.StartCmd.OpRateSet[k] = '\0';
		}

		i = j = k = 0;


		if(*(mib->mib_ApMode)==AP_MODE_AandG)
		{
			while ( i < IEEEtypes_MAX_DATA_RATES_G && mib_StaCfg_p->OpRateSet2[i] != '\0') 
			{
				if ( mib_StaCfg_p->OpRateSet2[i] & 0x80) 
				{
					SmeCmd_p->Body.StartCmd.BssBasicRateSet2[j] = (mib_StaCfg_p->OpRateSet2[i] & 0x7f);
					SmeCmd_p->Body.StartCmd.OpRateSet2[k] = mib_StaCfg_p->OpRateSet2[i] & 0x7f;
					i++;j++;k++;
				}
				else
				{
					SmeCmd_p->Body.StartCmd.OpRateSet2[k] = mib_StaCfg_p->OpRateSet2[i] & 0x7f;
					i++;k++;
				}

			}
			if (i < IEEEtypes_MAX_DATA_RATES_G )
			{
				SmeCmd_p->Body.StartCmd.BssBasicRateSet2[j] = '\0';
				SmeCmd_p->Body.StartCmd.OpRateSet2[k] = '\0';
			}
		}



		/*   printf("SmeTask: Sending Start Cmd to MacMgmtAp Task\n"); */
		memcpy(&vmacSta_p->macStaAddr, mib_OpData_p->StaMacAddr, sizeof(IEEEtypes_MacAddr_t));

		if(*(mib->mib_ApMode)==AP_MODE_AandG)
			memcpy(&vmacSta_p->macStaAddr2, &vmacSta_p->macBssId2, sizeof(IEEEtypes_MacAddr_t));

		memcpy(&vmacSta_p->macBssId, mib_OpData_p->StaMacAddr, sizeof(IEEEtypes_MacAddr_t));
		//printk(KERN_CRIT "Event Initialize send SME start command\n");
#ifdef IEEE80211_DH
		evtSmeCmdMsg(vmacSta_p,(UINT8 *)SmeCmd_p);
#else
		//evtSmeCmdMsg(wlpptr->vmacSta_p,SmeCmd_p);
#endif /*IEEE80211_DH*/
		macMgmtMlme_StartCmd(vmacSta_p,&SmeCmd_p->Body.StartCmd);
	}
	return(OS_SUCCESS);
}