Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Highlighted
New Developer
Posts: 13
Registered: ‎02-17-2010
My Device: Z10
My Carrier: Vodafone
Accepted Solution

CellularBand Switch Types Error

I am trying to "switch" the CellularBand:

 

https://developer.blackberry.com/native/reference/cascades/bb__device__cellularband.html#enum-type

 

	switch (CellularBand()){
	case CellularBand.Gsm900: //do something;
	break;
	case CellularBand.Gsm1800: //do something;
	break;
    }

 But I get the error:

 

error: 'bb::device::CellularBand::~CellularBand()' is private

 

Can someone give an example of how to use this correctly?

Thanks.

Retired
Posts: 170
Registered: ‎09-06-2010
My Device: None
My Carrier: None

Re: CellularBand Switch Types Error

Hm, not really sure what you're trying to do with your code snippet since the "Bands" information is a bitmap field that you need to test, ...  but anyway, here's what I do:

 

...

CellularRadioInfo *_cellularRadioInfo = new CellularRadioInfo(this);

...

if (_cellularRadioInfo->bands() & CellularBand::Cdma0)
    qDebug() << "Cellular Band Cdma0 Supported" << endl;
if (_cellularRadioInfo->bands() & CellularBand::CdmaI)
    qDebug() << "Cellular Band CdmaI Supported" << endl;
...

etc.