head	1.2;
access;
symbols
	pkgsrc-2023Q2:1.1.0.76
	pkgsrc-2023Q2-base:1.1
	pkgsrc-2023Q1:1.1.0.74
	pkgsrc-2023Q1-base:1.1
	pkgsrc-2022Q4:1.1.0.72
	pkgsrc-2022Q4-base:1.1
	pkgsrc-2022Q3:1.1.0.70
	pkgsrc-2022Q3-base:1.1
	pkgsrc-2022Q2:1.1.0.68
	pkgsrc-2022Q2-base:1.1
	pkgsrc-2022Q1:1.1.0.66
	pkgsrc-2022Q1-base:1.1
	pkgsrc-2021Q4:1.1.0.64
	pkgsrc-2021Q4-base:1.1
	pkgsrc-2021Q3:1.1.0.62
	pkgsrc-2021Q3-base:1.1
	pkgsrc-2021Q2:1.1.0.60
	pkgsrc-2021Q2-base:1.1
	pkgsrc-2021Q1:1.1.0.58
	pkgsrc-2021Q1-base:1.1
	pkgsrc-2020Q4:1.1.0.56
	pkgsrc-2020Q4-base:1.1
	pkgsrc-2020Q3:1.1.0.54
	pkgsrc-2020Q3-base:1.1
	pkgsrc-2020Q2:1.1.0.50
	pkgsrc-2020Q2-base:1.1
	pkgsrc-2020Q1:1.1.0.30
	pkgsrc-2020Q1-base:1.1
	pkgsrc-2019Q4:1.1.0.52
	pkgsrc-2019Q4-base:1.1
	pkgsrc-2019Q3:1.1.0.48
	pkgsrc-2019Q3-base:1.1
	pkgsrc-2019Q2:1.1.0.46
	pkgsrc-2019Q2-base:1.1
	pkgsrc-2019Q1:1.1.0.44
	pkgsrc-2019Q1-base:1.1
	pkgsrc-2018Q4:1.1.0.42
	pkgsrc-2018Q4-base:1.1
	pkgsrc-2018Q3:1.1.0.40
	pkgsrc-2018Q3-base:1.1
	pkgsrc-2018Q2:1.1.0.38
	pkgsrc-2018Q2-base:1.1
	pkgsrc-2018Q1:1.1.0.36
	pkgsrc-2018Q1-base:1.1
	pkgsrc-2017Q4:1.1.0.34
	pkgsrc-2017Q4-base:1.1
	pkgsrc-2017Q3:1.1.0.32
	pkgsrc-2017Q3-base:1.1
	pkgsrc-2017Q2:1.1.0.28
	pkgsrc-2017Q2-base:1.1
	pkgsrc-2017Q1:1.1.0.26
	pkgsrc-2017Q1-base:1.1
	pkgsrc-2016Q4:1.1.0.24
	pkgsrc-2016Q4-base:1.1
	pkgsrc-2016Q3:1.1.0.22
	pkgsrc-2016Q3-base:1.1
	pkgsrc-2016Q2:1.1.0.20
	pkgsrc-2016Q2-base:1.1
	pkgsrc-2016Q1:1.1.0.18
	pkgsrc-2016Q1-base:1.1
	pkgsrc-2015Q4:1.1.0.16
	pkgsrc-2015Q4-base:1.1
	pkgsrc-2015Q3:1.1.0.14
	pkgsrc-2015Q3-base:1.1
	pkgsrc-2015Q2:1.1.0.12
	pkgsrc-2015Q2-base:1.1
	pkgsrc-2015Q1:1.1.0.10
	pkgsrc-2015Q1-base:1.1
	pkgsrc-2014Q4:1.1.0.8
	pkgsrc-2014Q4-base:1.1
	pkgsrc-2014Q3:1.1.0.6
	pkgsrc-2014Q3-base:1.1
	pkgsrc-2014Q2:1.1.0.4
	pkgsrc-2014Q2-base:1.1
	pkgsrc-2014Q1:1.1.0.2
	pkgsrc-2014Q1-base:1.1;
locks; strict;
comment	@// @;


1.2
date	2023.06.26.11.51.03;	author wiz;	state dead;
branches;
next	1.1;
commitid	czW2fBT8HzPz2suE;

1.1
date	2014.01.14.15.36.59;	author reinoud;	state Exp;
branches;
next	;
commitid	WM5tlRmEwXaib6lx;


desc
@@


1.2
log
@bossa: remove

Uses wxGTK28, which will be removed soon
@
text
@///////////////////////////////////////////////////////////////////////////////
// BOSSA
//
// Copyright (C) 2011-2012 ShumaTech http://www.shumatech.com/
//
// 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/>.
///////////////////////////////////////////////////////////////////////////////
#include "NetBSDPortFactory.h"
#include "PosixSerialPort.h"

#include <string.h>
#include <stdio.h>

#include <string>

NetBSDPortFactory::NetBSDPortFactory()
{
    _dir = opendir("/dev");
}

NetBSDPortFactory::~NetBSDPortFactory()
{
    if (_dir)
        closedir(_dir);
}

SerialPort::Ptr
NetBSDPortFactory::create(const std::string& name)
{
    bool isUsb = false;

    if (name.find("ttyU") != std::string::npos)
        isUsb = true;

    return SerialPort::Ptr(new PosixSerialPort(name, isUsb));
}

std::string
NetBSDPortFactory::begin()
{
    if (!_dir)
        return end();

    rewinddir(_dir);

    return next();
}

std::string
NetBSDPortFactory::next()
{
    struct dirent* entry;

    if (!_dir)
        return end();

    while ((entry = readdir(_dir)))
    {
        if (strncmp("ttyU", entry->d_name, sizeof("ttyU") - 1) == 0)
            return std::string(entry->d_name);
        else if (strncmp("ttyS", entry->d_name, sizeof("ttyS") - 1) == 0)
            return std::string(entry->d_name);
    }

    return end();
}

std::string
NetBSDPortFactory::end()
{
    return std::string();
}
@


1.1
log
@Add bossa-20140109:

BOSSA is a flash programming utility for Atmel's SAM family of flash-based ARM
microcontrollers. The motivation behind BOSSA is to create a simple,
easy-to-use, open source utility to replace Atmel's SAM-BA software.
@
text
@@

