#701 P25 Phase 2 Tone Metadata and Channel State (#702)

* Resolves #701 Updates P25P2 Tone metadata handling and P25P2 channel state management.
This commit is contained in:
Denny Sheirer
2020-03-28 09:51:11 +00:00
committed by GitHub
parent 41df207bb9
commit 158c8b4b8a
25 changed files with 493 additions and 611 deletions

View File

@@ -37,6 +37,6 @@ public abstract class RadioIdentifier extends IntegerIdentifier
@Override
public boolean isValid()
{
return getValue() > 0;
return getValue() >= 0;
}
}

View File

@@ -1,48 +0,0 @@
/*
*
* * ******************************************************************************
* * Copyright (C) 2014-2019 Dennis Sheirer
* *
* * This program is free software: you can redistribute it and/or modify
* * it under the terms of the GNU General Public License as published by
* * the Free Software Foundation, either version 3 of the License, or
* * (at your option) any later version.
* *
* * This program is distributed in the hope that it will be useful,
* * but WITHOUT ANY WARRANTY; without even the implied warranty of
* * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* * GNU General Public License for more details.
* *
* * You should have received a copy of the GNU General Public License
* * along with this program. If not, see <http://www.gnu.org/licenses/>
* * *****************************************************************************
*
*
*/
package io.github.dsheirer.identifier.tone;
import com.google.common.base.Joiner;
import io.github.dsheirer.identifier.Form;
import io.github.dsheirer.identifier.IdentifierClass;
import io.github.dsheirer.identifier.Role;
import io.github.dsheirer.identifier.string.StringListIdentifier;
import java.util.List;
/**
* Call Progress (ie dial tone, busy tone) tones identifier
*/
public abstract class CallProgressIdentifier extends StringListIdentifier
{
public CallProgressIdentifier(List<String> values)
{
super(values, IdentifierClass.USER, Form.CALL_PROGRESS_TONE, Role.TO);
}
@Override
public String toString()
{
return "CALL:" + Joiner.on("").join(getValue());
}
}

View File

@@ -1,48 +0,0 @@
/*
*
* * ******************************************************************************
* * Copyright (C) 2014-2019 Dennis Sheirer
* *
* * This program is free software: you can redistribute it and/or modify
* * it under the terms of the GNU General Public License as published by
* * the Free Software Foundation, either version 3 of the License, or
* * (at your option) any later version.
* *
* * This program is distributed in the hope that it will be useful,
* * but WITHOUT ANY WARRANTY; without even the implied warranty of
* * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* * GNU General Public License for more details.
* *
* * You should have received a copy of the GNU General Public License
* * along with this program. If not, see <http://www.gnu.org/licenses/>
* * *****************************************************************************
*
*
*/
package io.github.dsheirer.identifier.tone;
import com.google.common.base.Joiner;
import io.github.dsheirer.identifier.Form;
import io.github.dsheirer.identifier.IdentifierClass;
import io.github.dsheirer.identifier.Role;
import io.github.dsheirer.identifier.string.StringListIdentifier;
import java.util.List;
/**
* Dual-Tone Multi-Frequency (DTMF) tones identifier
*/
public abstract class DtmfIdentifier extends StringListIdentifier
{
public DtmfIdentifier(List<String> values)
{
super(values, IdentifierClass.USER, Form.DTMF, Role.TO);
}
@Override
public String toString()
{
return "DTMF:" + Joiner.on("").join(getValue());
}
}

View File

@@ -1,48 +0,0 @@
/*
*
* * ******************************************************************************
* * Copyright (C) 2014-2019 Dennis Sheirer
* *
* * This program is free software: you can redistribute it and/or modify
* * it under the terms of the GNU General Public License as published by
* * the Free Software Foundation, either version 3 of the License, or
* * (at your option) any later version.
* *
* * This program is distributed in the hope that it will be useful,
* * but WITHOUT ANY WARRANTY; without even the implied warranty of
* * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* * GNU General Public License for more details.
* *
* * You should have received a copy of the GNU General Public License
* * along with this program. If not, see <http://www.gnu.org/licenses/>
* * *****************************************************************************
*
*
*/
package io.github.dsheirer.identifier.tone;
import com.google.common.base.Joiner;
import io.github.dsheirer.identifier.Form;
import io.github.dsheirer.identifier.IdentifierClass;
import io.github.dsheirer.identifier.Role;
import io.github.dsheirer.identifier.string.StringListIdentifier;
import java.util.List;
/**
* Knox tones identifier
*/
public abstract class KnoxIdentifier extends StringListIdentifier
{
public KnoxIdentifier(List<String> values)
{
super(values, IdentifierClass.USER, Form.KNOX_TONE, Role.TO);
}
@Override
public String toString()
{
return "KNOX:" + Joiner.on("").join(getValue());
}
}

View File

@@ -1,46 +0,0 @@
/*
*
* * ******************************************************************************
* * Copyright (C) 2014-2019 Dennis Sheirer
* *
* * This program is free software: you can redistribute it and/or modify
* * it under the terms of the GNU General Public License as published by
* * the Free Software Foundation, either version 3 of the License, or
* * (at your option) any later version.
* *
* * This program is distributed in the hope that it will be useful,
* * but WITHOUT ANY WARRANTY; without even the implied warranty of
* * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* * GNU General Public License for more details.
* *
* * You should have received a copy of the GNU General Public License
* * along with this program. If not, see <http://www.gnu.org/licenses/>
* * *****************************************************************************
*
*
*/
package io.github.dsheirer.identifier.tone;
import io.github.dsheirer.protocol.Protocol;
import java.util.List;
public class P25CallProgressIdentifier extends CallProgressIdentifier
{
public P25CallProgressIdentifier(List<String> values)
{
super(values);
}
@Override
public Protocol getProtocol()
{
return Protocol.APCO25;
}
public static P25CallProgressIdentifier create(List<String> values)
{
return new P25CallProgressIdentifier(values);
}
}

View File

@@ -1,46 +0,0 @@
/*
*
* * ******************************************************************************
* * Copyright (C) 2014-2019 Dennis Sheirer
* *
* * This program is free software: you can redistribute it and/or modify
* * it under the terms of the GNU General Public License as published by
* * the Free Software Foundation, either version 3 of the License, or
* * (at your option) any later version.
* *
* * This program is distributed in the hope that it will be useful,
* * but WITHOUT ANY WARRANTY; without even the implied warranty of
* * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* * GNU General Public License for more details.
* *
* * You should have received a copy of the GNU General Public License
* * along with this program. If not, see <http://www.gnu.org/licenses/>
* * *****************************************************************************
*
*
*/
package io.github.dsheirer.identifier.tone;
import io.github.dsheirer.protocol.Protocol;
import java.util.List;
public class P25DtmfIdentifier extends DtmfIdentifier
{
public P25DtmfIdentifier(List<String> values)
{
super(values);
}
@Override
public Protocol getProtocol()
{
return Protocol.APCO25;
}
public static P25DtmfIdentifier create(List<String> values)
{
return new P25DtmfIdentifier(values);
}
}

View File

@@ -1,46 +0,0 @@
/*
*
* * ******************************************************************************
* * Copyright (C) 2014-2019 Dennis Sheirer
* *
* * This program is free software: you can redistribute it and/or modify
* * it under the terms of the GNU General Public License as published by
* * the Free Software Foundation, either version 3 of the License, or
* * (at your option) any later version.
* *
* * This program is distributed in the hope that it will be useful,
* * but WITHOUT ANY WARRANTY; without even the implied warranty of
* * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* * GNU General Public License for more details.
* *
* * You should have received a copy of the GNU General Public License
* * along with this program. If not, see <http://www.gnu.org/licenses/>
* * *****************************************************************************
*
*
*/
package io.github.dsheirer.identifier.tone;
import io.github.dsheirer.protocol.Protocol;
import java.util.List;
public class P25KnoxIdentifier extends KnoxIdentifier
{
public P25KnoxIdentifier(List<String> values)
{
super(values);
}
@Override
public Protocol getProtocol()
{
return Protocol.APCO25;
}
public static P25KnoxIdentifier create(List<String> values)
{
return new P25KnoxIdentifier(values);
}
}

View File

@@ -26,11 +26,14 @@ import io.github.dsheirer.protocol.Protocol;
import java.util.List;
/**
* P25 Phase II AMBE audio codec tone metadata
*/
public class P25ToneIdentifier extends ToneIdentifier
{
public P25ToneIdentifier(List<String> values)
public P25ToneIdentifier(String value)
{
super(values);
super(value);
}
@Override
@@ -39,8 +42,8 @@ public class P25ToneIdentifier extends ToneIdentifier
return Protocol.APCO25;
}
public static P25ToneIdentifier create(List<String> values)
public static P25ToneIdentifier create(String value)
{
return new P25ToneIdentifier(values);
return new P25ToneIdentifier(value);
}
}

View File

@@ -22,27 +22,18 @@
package io.github.dsheirer.identifier.tone;
import com.google.common.base.Joiner;
import io.github.dsheirer.identifier.Form;
import io.github.dsheirer.identifier.IdentifierClass;
import io.github.dsheirer.identifier.Role;
import io.github.dsheirer.identifier.string.StringListIdentifier;
import java.util.List;
import io.github.dsheirer.identifier.string.StringIdentifier;
/**
* Pass-band audio tones identifier
*/
public abstract class ToneIdentifier extends StringListIdentifier
public abstract class ToneIdentifier extends StringIdentifier
{
public ToneIdentifier(List<String> values)
public ToneIdentifier(String value)
{
super(values, IdentifierClass.USER, Form.TONE, Role.TO);
}
@Override
public String toString()
{
return "TONES:" + Joiner.on("").join(getValue());
super(value, IdentifierClass.USER, Form.TONE, Role.FROM);
}
}